summaryrefslogtreecommitdiff
path: root/coverage/inorout.py
diff options
context:
space:
mode:
Diffstat (limited to 'coverage/inorout.py')
-rw-r--r--coverage/inorout.py7
1 files changed, 2 insertions, 5 deletions
diff --git a/coverage/inorout.py b/coverage/inorout.py
index 2a19ba69..0eea62ae 100644
--- a/coverage/inorout.py
+++ b/coverage/inorout.py
@@ -14,6 +14,7 @@ import sys
import traceback
from coverage import env
+from coverage.backward import code_object
from coverage.disposition import FileDisposition, disposition_init
from coverage.files import TreeMatcher, FnmatchMatcher, ModuleMatcher
from coverage.files import prep_patterns, find_python_files, canonical_filename
@@ -157,11 +158,7 @@ class InOrOut(object):
# objects still have the file names. So dig into one to find
# the path to exclude. The "filename" might be synthetic,
# don't be fooled by those.
- structseq_new = _structseq.structseq_new
- try:
- structseq_file = structseq_new.func_code.co_filename
- except AttributeError:
- structseq_file = structseq_new.__code__.co_filename
+ structseq_file = code_object(_structseq.structseq_new).co_filename
if not structseq_file.startswith("<"):
self.pylib_paths.add(canonical_path(structseq_file))