From 9b603e707704102275d5521cc6c110f357e7ea96 Mon Sep 17 00:00:00 2001 From: Ned Batchelder Date: Fri, 23 Nov 2012 21:54:56 -0500 Subject: If a file is missing, don't show an error message with the wrong path. #60. --- coverage/files.py | 14 +++++--------- 1 file changed, 5 insertions(+), 9 deletions(-) (limited to 'coverage/files.py') 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] -- cgit v1.2.1