summaryrefslogtreecommitdiff
path: root/coverage/env.py
diff options
context:
space:
mode:
authorNed Batchelder <ned@nedbatchelder.com>2018-10-05 10:39:28 -0400
committerNed Batchelder <ned@nedbatchelder.com>2018-10-06 10:25:29 -0400
commit04ff188349df84f73167108314e9698059830279 (patch)
tree679969c306537f5becab63ec9edc6a00a459098c /coverage/env.py
parentcf7e8717d73e638d92838f8534712351dda9e0f1 (diff)
downloadpython-coveragepy-git-04ff188349df84f73167108314e9698059830279.tar.gz
Finally jumps back to exiting lines
In Python 3.8, when a finally clause is run because a line in the try block is exiting the block, the exiting line is visited again after the finally block.
Diffstat (limited to 'coverage/env.py')
-rw-r--r--coverage/env.py10
1 files changed, 10 insertions, 0 deletions
diff --git a/coverage/env.py b/coverage/env.py
index e35d026b..aa8bb8f6 100644
--- a/coverage/env.py
+++ b/coverage/env.py
@@ -24,6 +24,16 @@ PYVERSION = sys.version_info
PY2 = PYVERSION < (3, 0)
PY3 = PYVERSION >= (3, 0)
+# Python behavior
+class PYBEHAVIOR(object):
+ """Flags indicating this Python's behavior."""
+
+ # 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
+ # work?
+ finally_jumps_back = (PYVERSION >= (3, 8))
+
# Coverage.py specifics.
# Are we using the C-implemented trace function?