Mercurial > hg
comparison mercurial/policy.py @ 36627:418f9ea20c35
py3: unblock C extensions on Python 3
Please make sure to build C extensions before running tests with -l:
$ make local PYTHON=python3
author | Yuya Nishihara <yuya@tcha.org> |
---|---|
date | Sat, 03 Mar 2018 05:51:34 -0500 |
parents | 29dd37a418aa |
children | 430fdb717549 |
comparison
equal
deleted
inserted
replaced
36626:6754d0c5e1b5 | 36627:418f9ea20c35 |
---|---|
41 # | 41 # |
42 # The canonical way to do this is to test platform.python_implementation(). | 42 # The canonical way to do this is to test platform.python_implementation(). |
43 # But we don't import platform and don't bloat for it here. | 43 # But we don't import platform and don't bloat for it here. |
44 if r'__pypy__' in sys.builtin_module_names: | 44 if r'__pypy__' in sys.builtin_module_names: |
45 policy = b'cffi' | 45 policy = b'cffi' |
46 | |
47 # Our C extensions aren't yet compatible with Python 3. So use pure Python | |
48 # on Python 3 for now. | |
49 if sys.version_info[0] >= 3: | |
50 policy = b'py' | |
51 | 46 |
52 # Environment variable can always force settings. | 47 # Environment variable can always force settings. |
53 if sys.version_info[0] >= 3: | 48 if sys.version_info[0] >= 3: |
54 if r'HGMODULEPOLICY' in os.environ: | 49 if r'HGMODULEPOLICY' in os.environ: |
55 policy = os.environ[r'HGMODULEPOLICY'].encode(r'utf-8') | 50 policy = os.environ[r'HGMODULEPOLICY'].encode(r'utf-8') |