From 3d43c74cd2dd8c66c29572bc04a4b0de3e206364 Mon Sep 17 00:00:00 2001 From: Ned Batchelder Date: Sat, 1 May 2021 14:19:24 -0400 Subject: refactor: remove some unneeded behavior conditionals --- coverage/env.py | 15 --------------- coverage/execfile.py | 5 ++--- 2 files changed, 2 insertions(+), 18 deletions(-) (limited to 'coverage') diff --git a/coverage/env.py b/coverage/env.py index f0d98a27..ab59e275 100644 --- a/coverage/env.py +++ b/coverage/env.py @@ -53,21 +53,6 @@ class PYBEHAVIOR(object): if pep626: optimize_if_not_debug2 = False - # 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)) and not (PYPY and PYPYVERSION < (7, 2)) diff --git a/coverage/execfile.py b/coverage/execfile.py index 600b2278..338fb477 100644 --- a/coverage/execfile.py +++ b/coverage/execfile.py @@ -346,9 +346,8 @@ 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.PYBEHAVIOR.size_in_pyc: - # 3.3 added another long to the header (size), skip it. - fpyc.read(4) + # 3.3 added another long to the header (size), skip it. + fpyc.read(4) # The rest of the file is the code object we want. code = marshal.load(fpyc) -- cgit v1.2.1