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