summaryrefslogtreecommitdiff
path: root/coverage/env.py
diff options
context:
space:
mode:
authorNed Batchelder <ned@nedbatchelder.com>2019-03-24 13:05:20 -0400
committerNed Batchelder <ned@nedbatchelder.com>2019-03-24 13:05:20 -0400
commit820b255f34a0aac8670b0c819153bb8b38c4b2c6 (patch)
tree61cc57a000b6d73d20f7ecadec76a9fb79b04206 /coverage/env.py
parentce55ad5567d461cebf7bd73d9662c6ac36696106 (diff)
downloadpython-coveragepy-git-820b255f34a0aac8670b0c819153bb8b38c4b2c6.tar.gz
Move more PYVERSION to be PYBEHAVIOR
Diffstat (limited to 'coverage/env.py')
-rw-r--r--coverage/env.py27
1 files changed, 27 insertions, 0 deletions
diff --git a/coverage/env.py b/coverage/env.py
index 27602431..83b4be65 100644
--- a/coverage/env.py
+++ b/coverage/env.py
@@ -28,12 +28,39 @@ PY3 = PYVERSION >= (3, 0)
class PYBEHAVIOR(object):
"""Flags indicating this Python's behavior."""
+ # Is "if __debug__" optimized away?
+ optimize_if_debug = (not PYPY)
+
+ # If "if not __debug__" optimized away?
+ optimize_if_not_debug = (not PYPY) and (PYVERSION >= (3, 7, 0, 'alpha', 4))
+
+ # Do we have yield-from?
+ yield_from = (PYVERSION >= (3, 3))
+
+ # Do we have PEP 420 namespace packages?
+ namespaces_pep420 = (PYVERSION >= (3, 3))
+
# Do .pyc files have the source file size recorded in them?
size_in_pyc = (PYVERSION >= (3, 3))
+ # Do we have async and await syntax?
+ async_syntax = (PYVERSION >= (3, 5))
+
+ # PEP 448 defined additional unpacking generalizations
+ unpackings_pep448 = (PYVERSION >= (3, 5))
+
+ # Can co_lnotab have negative deltas?
+ negative_lnotab = (PYVERSION >= (3, 6))
+
# Do .pyc files conform to PEP 552? Hash-based pyc's.
hashed_pyc_pep552 = (PYVERSION >= (3, 7, 0, 'alpha', 4))
+ # Python 3.7.0b3 changed the behavior of the sys.path[0] entry for -m. It
+ # used to be an empty string (meaning the current directory). It changed
+ # to be the actual path to the current directory, so that os.chdir wouldn't
+ # affect the outcome.
+ actual_syspath0_dash_m = (PYVERSION >= (3, 7, 0, 'beta', 3))
+
# When a break/continue/return statement in a try block jumps to a finally
# block, does the finally block do the break/continue/return (pre-3.8), or
# does the finally jump back to the break/continue/return (3.8) to do the