diff options
-rw-r--r-- | coverage/env.py | 13 | ||||
-rw-r--r-- | tests/test_process.py | 2 |
2 files changed, 8 insertions, 7 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.""" diff --git a/tests/test_process.py b/tests/test_process.py index 9fb930de..e4886156 100644 --- a/tests/test_process.py +++ b/tests/test_process.py @@ -1099,7 +1099,7 @@ class ExcepthookTest(CoverageTest): self.assertEqual(line_counts(data)['excepthook.py'], 7) def test_excepthook_exit(self): - if env.PYPY or env.JYTHON: + if not env.CPYTHON: self.skipTest("non-CPython handles excepthook exits differently, punt for now.") self.make_file("excepthook_exit.py", """\ import sys |