diff options
author | Ned Batchelder <ned@nedbatchelder.com> | 2012-11-23 21:54:56 -0500 |
---|---|---|
committer | Ned Batchelder <ned@nedbatchelder.com> | 2012-11-23 21:54:56 -0500 |
commit | 9b603e707704102275d5521cc6c110f357e7ea96 (patch) | |
tree | 81116da37539a0ccb471f35cb8f31eedd8dac005 /coverage/files.py | |
parent | b18119c4949b4a4750a52ea8835e64f520b08c8a (diff) | |
download | python-coveragepy-9b603e707704102275d5521cc6c110f357e7ea96.tar.gz |
If a file is missing, don't show an error message with the wrong path. #60.
Diffstat (limited to 'coverage/files.py')
-rw-r--r-- | coverage/files.py | 14 |
1 files changed, 5 insertions, 9 deletions
diff --git a/coverage/files.py b/coverage/files.py index 40af7bf..3a3a773 100644 --- a/coverage/files.py +++ b/coverage/files.py @@ -34,19 +34,15 @@ class FileLocator(object): """ if filename not in self.canonical_filename_cache: - f = filename - if os.path.isabs(f) and not os.path.exists(f): - if self.get_zip_data(f) is None: - f = os.path.basename(f) - if not os.path.isabs(f): + if not os.path.isabs(filename): for path in [os.curdir] + sys.path: if path is None: continue - g = os.path.join(path, f) - if os.path.exists(g): - f = g + f = os.path.join(path, filename) + if os.path.exists(f): + filename = f break - cf = abs_file(f) + cf = abs_file(filename) self.canonical_filename_cache[filename] = cf return self.canonical_filename_cache[filename] |