equal
deleted
inserted
replaced
21 modulepolicy = '@MODULELOADPOLICY@' |
21 modulepolicy = '@MODULELOADPOLICY@' |
22 |
22 |
23 # By default, require the C extensions for performance reasons. |
23 # By default, require the C extensions for performance reasons. |
24 if modulepolicy == '@' 'MODULELOADPOLICY' '@': |
24 if modulepolicy == '@' 'MODULELOADPOLICY' '@': |
25 modulepolicy = 'c' |
25 modulepolicy = 'c' |
|
26 |
|
27 # PyPy doesn't load C extensions. |
|
28 # |
|
29 # 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. |
|
31 if '__pypy__' in sys.builtin_module_names: |
|
32 modulepolicy = 'py' |
26 |
33 |
27 # Environment variable can always force settings. |
34 # Environment variable can always force settings. |
28 modulepolicy = os.environ.get('HGMODULEPOLICY', modulepolicy) |
35 modulepolicy = os.environ.get('HGMODULEPOLICY', modulepolicy) |
29 |
36 |
30 # Modules that have both Python and C implementations. See also the |
37 # Modules that have both Python and C implementations. See also the |