Patchwork D7297: cleanup: remove now-obsolete wrong-arg-type annotations

login
register
mail settings
Submitter phabricator
Date Nov. 6, 2019, 11:25 p.m.
Message ID <differential-rev-PHID-DREV-ustr2d3hx2bct7f4l4no-req@mercurial-scm.org>
Download mbox | patch
Permalink /patch/42855/
State New
Headers show

Comments

phabricator - Nov. 6, 2019, 11:25 p.m.
durin42 created this revision.
Herald added a subscriber: mercurial-devel.
Herald added a reviewer: hg-reviewers.

REVISION SUMMARY
  The preceding commit around bytestr indirection resolved all of these.

REPOSITORY
  rHG Mercurial

REVISION DETAIL
  https://phab.mercurial-scm.org/D7297

AFFECTED FILES
  mercurial/branchmap.py
  mercurial/bundle2.py
  mercurial/dagparser.py

CHANGE DETAILS




To: durin42, #hg-reviewers
Cc: mercurial-devel
phabricator - Nov. 8, 2019, 4:48 p.m.
This revision now requires changes to proceed.
indygreg added a comment.
indygreg requested changes to this revision.


  Marking for revisions until we know what's going on with D7296 <https://phab.mercurial-scm.org/D7296>.

REPOSITORY
  rHG Mercurial

CHANGES SINCE LAST ACTION
  https://phab.mercurial-scm.org/D7297/new/

REVISION DETAIL
  https://phab.mercurial-scm.org/D7297

To: durin42, #hg-reviewers, indygreg
Cc: indygreg, mercurial-devel

Patch

diff --git a/mercurial/dagparser.py b/mercurial/dagparser.py
--- a/mercurial/dagparser.py
+++ b/mercurial/dagparser.py
@@ -168,9 +168,7 @@ 
     if not desc:
         return
 
-    wordchars = pycompat.bytestr(
-        string.ascii_letters + string.digits
-    )  # pytype: disable=wrong-arg-types
+    wordchars = pycompat.bytestr(string.ascii_letters + string.digits)
 
     labels = {}
     p1 = -1
@@ -179,9 +177,7 @@ 
     def resolve(ref):
         if not ref:
             return p1
-        elif ref[0] in pycompat.bytestr(
-            string.digits
-        ):  # pytype: disable=wrong-arg-types
+        elif ref[0] in pycompat.bytestr(string.digits):
             return r - int(ref)
         else:
             return labels[ref]
@@ -215,9 +211,7 @@ 
 
     c = nextch()
     while c != b'\0':
-        while c in pycompat.bytestr(
-            string.whitespace
-        ):  # pytype: disable=wrong-arg-types
+        while c in pycompat.bytestr(string.whitespace):
             c = nextch()
         if c == b'.':
             yield b'n', (r, [p1])
@@ -225,9 +219,7 @@ 
             r += 1
             c = nextch()
         elif c == b'+':
-            c, digs = nextrun(
-                nextch(), pycompat.bytestr(string.digits)
-            )  # pytype: disable=wrong-arg-types
+            c, digs = nextrun(nextch(), pycompat.bytestr(string.digits))
             n = int(digs)
             for i in pycompat.xrange(0, n):
                 yield b'n', (r, [p1])
diff --git a/mercurial/bundle2.py b/mercurial/bundle2.py
--- a/mercurial/bundle2.py
+++ b/mercurial/bundle2.py
@@ -653,9 +653,7 @@ 
         """add a stream level parameter"""
         if not name:
             raise error.ProgrammingError(b'empty parameter name')
-        if name[0:1] not in pycompat.bytestr(
-            string.ascii_letters  # pytype: disable=wrong-arg-types
-        ):
+        if name[0:1] not in pycompat.bytestr(string.ascii_letters):
             raise error.ProgrammingError(
                 b'non letter first character: %s' % name
             )
@@ -838,9 +836,7 @@ 
         """
         if not name:
             raise ValueError(r'empty parameter name')
-        if name[0:1] not in pycompat.bytestr(
-            string.ascii_letters  # pytype: disable=wrong-arg-types
-        ):
+        if name[0:1] not in pycompat.bytestr(string.ascii_letters):
             raise ValueError(r'non letter first character: %s' % name)
         try:
             handler = b2streamparamsmap[name.lower()]
diff --git a/mercurial/branchmap.py b/mercurial/branchmap.py
--- a/mercurial/branchmap.py
+++ b/mercurial/branchmap.py
@@ -269,13 +269,7 @@ 
             if repo.ui.debugflag:
                 msg = b'invalid %s: %s\n'
                 repo.ui.debug(
-                    msg
-                    % (
-                        _branchcachedesc(repo),
-                        pycompat.bytestr(
-                            inst  # pytype: disable=wrong-arg-types
-                        ),
-                    )
+                    msg % (_branchcachedesc(repo), pycompat.bytestr(inst))
                 )
             bcache = None