diff options
author | Ned Batchelder <ned@nedbatchelder.com> | 2021-01-10 08:33:07 -0500 |
---|---|---|
committer | Ned Batchelder <ned@nedbatchelder.com> | 2021-01-10 09:46:18 -0500 |
commit | 0ac78b400e6d45debc626748c1c94b9e1868c645 (patch) | |
tree | eab4f2b02da588d14f6a6e9e170ccfe8b552417b /coverage/env.py | |
parent | c7649842853de89c9a67c3f361f967349b17cb5f (diff) | |
download | python-coveragepy-git-0ac78b400e6d45debc626748c1c94b9e1868c645.tar.gz |
Clean up the platform constants in env.py
Diffstat (limited to 'coverage/env.py')
-rw-r--r-- | coverage/env.py | 13 |
1 files changed, 7 insertions, 6 deletions
diff --git a/coverage/env.py b/coverage/env.py index f2881e32..b91af463 100644 --- a/coverage/env.py +++ b/coverage/env.py @@ -11,24 +11,25 @@ import sys WINDOWS = sys.platform == "win32" LINUX = sys.platform.startswith("linux") +# Python implementations. +CPYTHON = (platform.python_implementation() == "CPython") +PYPY = (platform.python_implementation() == "PyPy") +JYTHON = (platform.python_implementation() == "Jython") +IRONPYTHON = (platform.python_implementation() == "IronPython") + # Python versions. We amend version_info with one more value, a zero if an # official version, or 1 if built from source beyond an official version. PYVERSION = sys.version_info + (int(platform.python_version()[-1] == "+"),) PY2 = PYVERSION < (3, 0) PY3 = PYVERSION >= (3, 0) -# Python implementations. -PYPY = (platform.python_implementation() == 'PyPy') if PYPY: PYPYVERSION = sys.pypy_version_info PYPY2 = PYPY and PY2 PYPY3 = PYPY and PY3 -JYTHON = (platform.python_implementation() == 'Jython') -IRONPYTHON = (platform.python_implementation() == 'IronPython') - -# Python behavior +# Python behavior. class PYBEHAVIOR(object): """Flags indicating this Python's behavior.""" |