scmutil: fix requires-file isalnum() check on first byte
authorAugie Fackler <augie@google.com>
Sun, 18 Feb 2018 14:37:36 -0500
changeset 36313 3f98634b6572
parent 36312 3ac8b5c1c36c
child 36314 be9c497e0bfd
scmutil: fix requires-file isalnum() check on first byte Slice instead of subscript to get a bytes from a bytes. # skip-blame just a py3 slice-instead-of-subscript change Differential Revision: https://phab.mercurial-scm.org/D2341
mercurial/scmutil.py
--- a/mercurial/scmutil.py	Sun Feb 18 14:29:04 2018 -0500
+++ b/mercurial/scmutil.py	Sun Feb 18 14:37:36 2018 -0500
@@ -887,7 +887,7 @@
     missings = []
     for r in requirements:
         if r not in supported:
-            if not r or not r[0].isalnum():
+            if not r or not r[0:1].isalnum():
                 raise error.RequirementError(_(".hg/requires file is corrupt"))
             missings.append(r)
     missings.sort()