Patchwork D2980: zope: force module import by importing symbols

login
register
mail settings
Submitter phabricator
Date March 30, 2018, 8:59 p.m.
Message ID <844740cca4578a80e23da2dba6342a7b@localhost.localdomain>
Download mbox | patch
Permalink /patch/30021/
State Not Applicable
Headers show

Comments

phabricator - March 30, 2018, 8:59 p.m.
This revision was automatically updated to reflect the committed changes.
Closed by commit rHGb9dd8403d8ff: zope: force module import by importing symbols (authored by indygreg, committed by ).

REPOSITORY
  rHG Mercurial

CHANGES SINCE LAST UPDATE
  https://phab.mercurial-scm.org/D2980?vs=7442&id=7443

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

AFFECTED FILES
  mercurial/thirdparty/zope/interface/declarations.py

CHANGE DETAILS




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

Patch

diff --git a/mercurial/thirdparty/zope/interface/declarations.py b/mercurial/thirdparty/zope/interface/declarations.py
--- a/mercurial/thirdparty/zope/interface/declarations.py
+++ b/mercurial/thirdparty/zope/interface/declarations.py
@@ -640,12 +640,9 @@ 
 
 # Try to get C base:
 try:
-    from . import _zope_interface_coptimizations
+    from ._zope_interface_coptimizations import ClassProvidesBase
 except ImportError:
     pass
-else:
-    from ._zope_interface_coptimizations import ClassProvidesBase
-
 
 class ClassProvides(Declaration, ClassProvidesBase):
     """Special descriptor for class __provides__
@@ -917,15 +914,13 @@ 
 _empty = Declaration()
 
 try:
-    from . import _zope_interface_coptimizations
+    from ._zope_interface_coptimizations import (
+        getObjectSpecification,
+        implementedBy,
+        ObjectSpecificationDescriptor,
+        providedBy,
+    )
 except ImportError:
     pass
-else:
-    from ._zope_interface_coptimizations import implementedBy
-    from ._zope_interface_coptimizations import providedBy
-    from ._zope_interface_coptimizations import (
-        getObjectSpecification)
-    from ._zope_interface_coptimizations import (
-        ObjectSpecificationDescriptor)
 
 objectSpecificationDescriptor = ObjectSpecificationDescriptor()