diff options
author | wjsi <swj0066@gmail.com> | 2019-01-05 11:17:52 +0800 |
---|---|---|
committer | Stefan Behnel <stefan_ml@behnel.de> | 2019-01-19 09:49:27 +0100 |
commit | 85bd382ef81357d2ab0e5295d8a9e976920d145c (patch) | |
tree | 16df7d1268dedb51659a4dfc9bc439bfe24ff6e3 | |
parent | e25dc72e94b82901341719c556d3510d849533a4 (diff) | |
download | cython-85bd382ef81357d2ab0e5295d8a9e976920d145c.tar.gz |
Fix inconsistency between trace files and report files
-rw-r--r-- | Cython/Coverage.py | 6 |
1 files changed, 4 insertions, 2 deletions
diff --git a/Cython/Coverage.py b/Cython/Coverage.py index f05e2b650..fa2f0ede1 100644 --- a/Cython/Coverage.py +++ b/Cython/Coverage.py @@ -74,7 +74,7 @@ class Plugin(CoveragePlugin): if c_file is None: c_file, py_file = self._find_source_files(filename) if not c_file: - return None + return None # unknown file # parse all source file paths and lines from C file # to learn about all relevant source files right away (pyx/pxi/pxd) @@ -82,7 +82,9 @@ class Plugin(CoveragePlugin): # is not from the main .pyx file but a file with a different # name than the .c file (which prevents us from finding the # .c file) - self._parse_lines(c_file, filename) + _, code = self._parse_lines(c_file, filename) + if code is None: + return None # no source found if self._file_path_map is None: self._file_path_map = {} |