Skip to content

Commit 0ac78b4

Browse files
committed
Clean up the platform constants in env.py
1 parent c764984 commit 0ac78b4

File tree

2 files changed

+8
-7
lines changed

2 files changed

+8
-7
lines changed

coverage/env.py

+7-6
Original file line numberDiff line numberDiff line change
@@ -11,24 +11,25 @@
1111
WINDOWS = sys.platform == "win32"
1212
LINUX = sys.platform.startswith("linux")
1313

14+
# Python implementations.
15+
CPYTHON = (platform.python_implementation() == "CPython")
16+
PYPY = (platform.python_implementation() == "PyPy")
17+
JYTHON = (platform.python_implementation() == "Jython")
18+
IRONPYTHON = (platform.python_implementation() == "IronPython")
19+
1420
# Python versions. We amend version_info with one more value, a zero if an
1521
# official version, or 1 if built from source beyond an official version.
1622
PYVERSION = sys.version_info + (int(platform.python_version()[-1] == "+"),)
1723
PY2 = PYVERSION < (3, 0)
1824
PY3 = PYVERSION >= (3, 0)
1925

20-
# Python implementations.
21-
PYPY = (platform.python_implementation() == 'PyPy')
2226
if PYPY:
2327
PYPYVERSION = sys.pypy_version_info
2428

2529
PYPY2 = PYPY and PY2
2630
PYPY3 = PYPY and PY3
2731

28-
JYTHON = (platform.python_implementation() == 'Jython')
29-
IRONPYTHON = (platform.python_implementation() == 'IronPython')
30-
31-
# Python behavior
32+
# Python behavior.
3233
class PYBEHAVIOR(object):
3334
"""Flags indicating this Python's behavior."""
3435

tests/test_process.py

+1-1
Original file line numberDiff line numberDiff line change
@@ -1099,7 +1099,7 @@ def excepthook(*args):
10991099
self.assertEqual(line_counts(data)['excepthook.py'], 7)
11001100

11011101
def test_excepthook_exit(self):
1102-
if env.PYPY or env.JYTHON:
1102+
if not env.CPYTHON:
11031103
self.skipTest("non-CPython handles excepthook exits differently, punt for now.")
11041104
self.make_file("excepthook_exit.py", """\
11051105
import sys

0 commit comments

Comments
 (0)