Show More
@@ -59,7 +59,7 class hgimporter(object): | |||
|
59 | 59 | return zl |
|
60 | 60 | |
|
61 | 61 | try: |
|
62 |
if modulepolicy |
|
|
62 | if modulepolicy in policy.policynoc: | |
|
63 | 63 | raise ImportError() |
|
64 | 64 | |
|
65 | 65 | zl = ziploader('mercurial') |
@@ -86,7 +86,7 class hgimporter(object): | |||
|
86 | 86 | stem = name.split('.')[-1] |
|
87 | 87 | |
|
88 | 88 | try: |
|
89 |
if modulepolicy |
|
|
89 | if modulepolicy in policy.policynoc: | |
|
90 | 90 | raise ImportError() |
|
91 | 91 | |
|
92 | 92 | modinfo = imp.find_module(stem, mercurial.__path__) |
@@ -14,10 +14,15 import sys | |||
|
14 | 14 | # |
|
15 | 15 | # c - require C extensions |
|
16 | 16 | # allow - allow pure Python implementation when C loading fails |
|
17 | # cffi - required cffi versions (implemented within pure module) | |
|
18 | # cffi-allow - allow pure Python implementation if cffi version is missing | |
|
17 | 19 | # py - only load pure Python modules |
|
18 | 20 | # |
|
19 | 21 | # By default, require the C extensions for performance reasons. |
|
20 | 22 | policy = 'c' |
|
23 | policynoc = ('cffi', 'cffi-allow', 'py') | |
|
24 | policynocffi = ('c', 'py') | |
|
25 | ||
|
21 | 26 | try: |
|
22 | 27 | from . import __modulepolicy__ |
|
23 | 28 | policy = __modulepolicy__.modulepolicy |
@@ -29,7 +34,7 except ImportError: | |||
|
29 | 34 | # The canonical way to do this is to test platform.python_implementation(). |
|
30 | 35 | # But we don't import platform and don't bloat for it here. |
|
31 | 36 | if '__pypy__' in sys.builtin_module_names: |
|
32 |
policy = ' |
|
|
37 | policy = 'cffi' | |
|
33 | 38 | |
|
34 | 39 | # Our C extensions aren't yet compatible with Python 3. So use pure Python |
|
35 | 40 | # on Python 3 for now. |
General Comments 0
You need to be logged in to leave comments.
Login now