summaryrefslogtreecommitdiff
path: root/coverage/env.py
diff options
context:
space:
mode:
Diffstat (limited to 'coverage/env.py')
-rw-r--r--coverage/env.py9
1 files changed, 5 insertions, 4 deletions
diff --git a/coverage/env.py b/coverage/env.py
index 175b3092..ab9dbe92 100644
--- a/coverage/env.py
+++ b/coverage/env.py
@@ -11,8 +11,9 @@ import sys
WINDOWS = sys.platform == "win32"
LINUX = sys.platform.startswith("linux")
-# Python versions.
-PYVERSION = sys.version_info
+# Python versions. We amend version_info with one more value, a zero if an
+# official version, or 1 if built from source beyond an official version.
+PYVERSION = sys.version_info + (int(platform.python_version()[-1] == "+"),)
PY2 = PYVERSION < (3, 0)
PY3 = PYVERSION >= (3, 0)
@@ -84,9 +85,9 @@ class PYBEHAVIOR(object):
# Python 3.9a1 made sys.argv[0] and other reported files absolute paths.
report_absolute_files = (PYVERSION >= (3, 9))
- # Python 3.9a2 changed how return/finally was traced, but it could be
+ # Python 3.9a2 changed how return/finally was traced, but it was
# temporary.
- bug39114 = (PYVERSION >= (3, 9, 0, 'alpha', 2))
+ bug39114 = (PYVERSION == (3, 9, 0, 'alpha', 2, 0))
# Coverage.py specifics.