From 319732d38dda3a0897c78b82f0f5597fe32a8183 Mon Sep 17 00:00:00 2001 From: Ned Batchelder Date: Sun, 26 Oct 2014 17:00:30 -0400 Subject: Test on PyPy3 --- coverage/control.py | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) (limited to 'coverage/control.py') diff --git a/coverage/control.py b/coverage/control.py index 4c087655..d2110552 100644 --- a/coverage/control.py +++ b/coverage/control.py @@ -248,7 +248,11 @@ class Coverage(object): # PyPy 2.4 has no __file__ in the builtin modules, but the code # objects still have the filenames. So dig into one to find # the path to exclude. - structseq_file = _structseq.structseq_new.func_code.co_filename + structseq_new = _structseq.structseq_new + try: + structseq_file = structseq_new.func_code.co_filename + except AttributeError: + structseq_file = structseq_new.__code__.co_filename self.pylib_dirs.add(self._canonical_dir(structseq_file)) # To avoid tracing the coverage code itself, we skip anything located -- cgit v1.2.1