py3: use startswith() instead of slicing to detect leading whitespace
authorYuya Nishihara <yuya@tcha.org>
Sun, 04 Mar 2018 15:24:45 -0500
changeset 36729 389b950f5190
parent 36728 f14ba6eb2b5a
child 36730 a22915edc279
py3: use startswith() instead of slicing to detect leading whitespace
mercurial/dispatch.py
--- a/mercurial/dispatch.py	Sun Mar 04 16:06:47 2018 -0500
+++ b/mercurial/dispatch.py	Sun Mar 04 15:24:45 2018 -0500
@@ -158,7 +158,7 @@
     if len(inst.args) > 1:
         write(_("hg: parse error at %s: %s\n") %
               (pycompat.bytestr(inst.args[1]), inst.args[0]))
-        if (inst.args[0][0] == ' '):
+        if inst.args[0].startswith(' '):
             write(_("unexpected leading whitespace\n"))
     else:
         write(_("hg: parse error: %s\n") % inst.args[0])