diff options
author | Ned Batchelder <ned@nedbatchelder.com> | 2020-09-12 16:33:13 -0400 |
---|---|---|
committer | Ned Batchelder <ned@nedbatchelder.com> | 2020-09-12 16:33:13 -0400 |
commit | 1c13cb9cce73bf1e47977be89ef3b086e36ef3c8 (patch) | |
tree | e9ee8c4e244cc651575d066d5d3326dbd77539b2 /coverage/env.py | |
parent | c3159081ae67864f75aacc1b86310fe9d8d614cb (diff) | |
download | python-coveragepy-git-nedbat/test-2506.tar.gz |
Adapt to https://github.com/python/cpython/pull/22027nedbat/test-2506
Diffstat (limited to 'coverage/env.py')
-rw-r--r-- | coverage/env.py | 4 |
1 files changed, 3 insertions, 1 deletions
diff --git a/coverage/env.py b/coverage/env.py index b5da3b47..17ace169 100644 --- a/coverage/env.py +++ b/coverage/env.py @@ -17,6 +17,8 @@ PYVERSION = sys.version_info + (int(platform.python_version()[-1] == "+"),) PY2 = PYVERSION < (3, 0) PY3 = PYVERSION >= (3, 0) +NOOPT = getattr(sys.flags, "noopt", False) + # Python implementations. PYPY = (platform.python_implementation() == 'PyPy') if PYPY: @@ -80,7 +82,7 @@ class PYBEHAVIOR(object): trace_decorated_def = (PYVERSION >= (3, 8)) # Are while-true loops optimized into absolute jumps with no loop setup? - nix_while_true = (PYVERSION >= (3, 8)) + nix_while_true = (PYVERSION >= (3, 8)) and not NOOPT # Python 3.9a1 made sys.argv[0] and other reported files absolute paths. report_absolute_files = (PYVERSION >= (3, 9)) |