Patchwork D7408: extensions: hide two confusing import statements from pytype

login
register
mail settings
Submitter phabricator
Date Nov. 14, 2019, 9:12 p.m.
Message ID <differential-rev-PHID-DREV-t4o3ps26wwq342swuaqn-req@mercurial-scm.org>
Download mbox | patch
Permalink /patch/43212/
State Superseded
Headers show

Comments

phabricator - Nov. 14, 2019, 9:12 p.m.
durin42 created this revision.
Herald added a subscriber: mercurial-devel.
Herald added a reviewer: hg-reviewers.

REPOSITORY
  rHG Mercurial

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

AFFECTED FILES
  mercurial/extensions.py

CHANGE DETAILS




To: durin42, #hg-reviewers
Cc: mercurial-devel
phabricator - Nov. 15, 2019, 1:31 p.m.
dlax added a comment.
dlax accepted this revision.


  Out of curiosity, where does this `__index__` value come from?

REPOSITORY
  rHG Mercurial

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

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

To: durin42, #hg-reviewers, dlax
Cc: dlax, mercurial-devel
phabricator - Nov. 15, 2019, 4:31 p.m.
durin42 added a comment.


  In D7408#109174 <https://phab.mercurial-scm.org/D7408#109174>, @dlax wrote:
  
  > Out of curiosity, where does this `__index__` value come from?
  
  Beats me.

REPOSITORY
  rHG Mercurial

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

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

To: durin42, #hg-reviewers, dlax
Cc: dlax, mercurial-devel
phabricator - Nov. 19, 2019, 3:45 a.m.
This revision is now accepted and ready to land.
indygreg added a comment.
indygreg accepted this revision.


  Where does `hgext.__index__` come from?!

REPOSITORY
  rHG Mercurial

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

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

To: durin42, #hg-reviewers, dlax, indygreg
Cc: indygreg, dlax, mercurial-devel
phabricator - Nov. 19, 2019, 7:55 a.m.
dlax added a comment.


  In D7408#109565 <https://phab.mercurial-scm.org/D7408#109565>, @indygreg wrote:
  
  > Where does `hgext.__index__` come from?!
  
  This is generated by setup.py, apparently only when building with py2exe.

REPOSITORY
  rHG Mercurial

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

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

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

Patch

diff --git a/mercurial/extensions.py b/mercurial/extensions.py
--- a/mercurial/extensions.py
+++ b/mercurial/extensions.py
@@ -781,7 +781,7 @@ 
 def disabled():
     '''find disabled extensions from hgext. returns a dict of {name: desc}'''
     try:
-        from hgext import __index__
+        from hgext import __index__  # pytype: disable=import-error
 
         return dict(
             (name, gettext(desc))
@@ -807,7 +807,7 @@ 
 def disabledext(name):
     '''find a specific disabled extension from hgext. returns desc'''
     try:
-        from hgext import __index__
+        from hgext import __index__  # pytype: disable=import-error
 
         if name in _order:  # enabled
             return