22 # Python versions. |
22 # Python versions. |
23 PYVERSION = sys.version_info |
23 PYVERSION = sys.version_info |
24 PY2 = PYVERSION < (3, 0) |
24 PY2 = PYVERSION < (3, 0) |
25 PY3 = PYVERSION >= (3, 0) |
25 PY3 = PYVERSION >= (3, 0) |
26 |
26 |
|
27 # Python behavior |
|
28 class PYBEHAVIOR(object): |
|
29 """Flags indicating this Python's behavior.""" |
|
30 |
|
31 # When a break/continue/return statement in a try block jumps to a finally |
|
32 # block, does the finally block do the break/continue/return (pre-3.8), or |
|
33 # does the finally jump back to the break/continue/return (3.8) to do the |
|
34 # work? |
|
35 finally_jumps_back = (PYVERSION >= (3, 8)) |
|
36 |
|
37 # When a function is decorated, does the trace function get called for the |
|
38 # @-line and also the def-line (new behavior in 3.8)? Or just the @-line |
|
39 # (old behavior)? |
|
40 trace_decorated_def = (PYVERSION >= (3, 8)) |
|
41 |
|
42 # Are while-true loops optimized into absolute jumps with no loop setup? |
|
43 nix_while_true = (PYVERSION >= (3, 8)) |
|
44 |
27 # Coverage.py specifics. |
45 # Coverage.py specifics. |
28 |
46 |
29 # Are we using the C-implemented trace function? |
47 # Are we using the C-implemented trace function? |
30 C_TRACER = os.getenv('COVERAGE_TEST_TRACER', 'c') == 'c' |
48 C_TRACER = os.getenv('COVERAGE_TEST_TRACER', 'c') == 'c' |
31 |
49 |