summaryrefslogtreecommitdiff
path: root/coverage/files.py
diff options
context:
space:
mode:
authorNed Batchelder <ned@nedbatchelder.com>2012-11-23 21:54:56 -0500
committerNed Batchelder <ned@nedbatchelder.com>2012-11-23 21:54:56 -0500
commit40c37c04c11840bf85652af5b0128a1ee7bd69de (patch)
treeba04834fccad98aba8d452e1986d615b948cfe07 /coverage/files.py
parent289aa97e1582002dd2407acf4654c968b2349571 (diff)
downloadpython-coveragepy-git-40c37c04c11840bf85652af5b0128a1ee7bd69de.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.py14
1 files changed, 5 insertions, 9 deletions
diff --git a/coverage/files.py b/coverage/files.py
index 40af7bf7..3a3a7732 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]