changeset 36729:389b950f5190

py3: use startswith() instead of slicing to detect leading whitespace
author Yuya Nishihara <yuya@tcha.org>
date Sun, 04 Mar 2018 15:24:45 -0500
parents f14ba6eb2b5a
children a22915edc279
files mercurial/dispatch.py
diffstat 1 files changed, 1 insertions(+), 1 deletions(-) [+]
line wrap: on
line diff
--- 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])