D7410: extensions: suppress a pytype failure due to a typeshed bug

durin42 (Augie Fackler) phabricator at mercurial-scm.org
Fri Nov 15 11:32:46 EST 2019


durin42 edited the summary of this revision.
durin42 retitled this revision from "extensions: suppress a strange pytype failure" to "extensions: suppress a pytype failure due to a typeshed bug".
durin42 updated this revision to Diff 18159.

REPOSITORY
  rHG Mercurial

CHANGES SINCE LAST UPDATE
  https://phab.mercurial-scm.org/D7410?vs=18103&id=18159

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

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

AFFECTED FILES
  mercurial/extensions.py

CHANGE DETAILS

diff --git a/mercurial/extensions.py b/mercurial/extensions.py
--- a/mercurial/extensions.py
+++ b/mercurial/extensions.py
@@ -92,7 +92,11 @@
         # module/__init__.py style
         d, f = os.path.split(path)
         fd, fpath, desc = imp.find_module(f, [d])
-        return imp.load_module(module_name, fd, fpath, desc)
+        # When https://github.com/python/typeshed/issues/3466 is fixed
+        # and in a pytype release we can drop this disable.
+        return imp.load_module(
+            module_name, fd, fpath, desc  # pytype: disable=wrong-arg-types
+        )
     else:
         try:
             return imp.load_source(module_name, path)



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


More information about the Mercurial-devel mailing list