Mercurial > hg
comparison mercurial/__init__.py @ 28513:859af6e78368
mercurial: use pure Python module policy on Python 3
The C extensions don't yet work with Python 3. Let's minimize the
work required to get Mercurial running on Python 3 by always using
the pure Python module policy on Python 3.
author | Gregory Szorc <gregory.szorc@gmail.com> |
---|---|
date | Sat, 12 Mar 2016 13:19:19 -0800 |
parents | 17b85d739b62 |
children | b3a677c82a35 |
comparison
equal
deleted
inserted
replaced
28512:b957b4c6cad8 | 28513:859af6e78368 |
---|---|
31 # PyPy doesn't load C extensions. | 31 # PyPy doesn't load C extensions. |
32 # | 32 # |
33 # The canonical way to do this is to test platform.python_implementation(). | 33 # The canonical way to do this is to test platform.python_implementation(). |
34 # But we don't import platform and don't bloat for it here. | 34 # But we don't import platform and don't bloat for it here. |
35 if '__pypy__' in sys.builtin_module_names: | 35 if '__pypy__' in sys.builtin_module_names: |
36 modulepolicy = 'py' | |
37 | |
38 # Our C extensions aren't yet compatible with Python 3. So use pure Python | |
39 # on Python 3 for now. | |
40 if sys.version_info[0] >= 3: | |
36 modulepolicy = 'py' | 41 modulepolicy = 'py' |
37 | 42 |
38 # Environment variable can always force settings. | 43 # Environment variable can always force settings. |
39 modulepolicy = os.environ.get('HGMODULEPOLICY', modulepolicy) | 44 modulepolicy = os.environ.get('HGMODULEPOLICY', modulepolicy) |
40 | 45 |