summaryrefslogtreecommitdiff
path: root/coverage/execfile.py
diff options
context:
space:
mode:
Diffstat (limited to 'coverage/execfile.py')
-rw-r--r--coverage/execfile.py10
1 files changed, 3 insertions, 7 deletions
diff --git a/coverage/execfile.py b/coverage/execfile.py
index 4fc6a85f..97997b06 100644
--- a/coverage/execfile.py
+++ b/coverage/execfile.py
@@ -124,11 +124,7 @@ class PyRunner(object):
should_update_sys_path = True
if self.as_module:
- # 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.
- if env.PYVERSION >= (3, 7, 0, 'beta', 3):
+ if env.PYBEHAVIOR.actual_syspath0_dash_m:
path0 = os.getcwd()
else:
path0 = ""
@@ -290,7 +286,7 @@ def make_code_from_pyc(filename):
raise NoCode("Bad magic number in .pyc file")
date_based = True
- if env.PYVERSION >= (3, 7, 0, 'alpha', 4):
+ if env.PYBEHAVIOR.hashed_pyc_pep552:
flags = struct.unpack('<L', fpyc.read(4))[0]
hash_based = flags & 0x01
if hash_based:
@@ -299,7 +295,7 @@ def make_code_from_pyc(filename):
if date_based:
# Skip the junk in the header that we don't need.
fpyc.read(4) # Skip the moddate.
- if env.PYVERSION >= (3, 3):
+ if env.PYBEHAVIOR.size_in_pyc:
# 3.3 added another long to the header (size), skip it.
fpyc.read(4)