From 8216f6839fe4f07b5e05f55ffcb34b8d8c684c93 Mon Sep 17 00:00:00 2001 From: Geoff Bache Date: Fri, 10 Dec 2010 21:34:14 +0100 Subject: Handle compiled files under Jython --- coverage/control.py | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) (limited to 'coverage/control.py') diff --git a/coverage/control.py b/coverage/control.py index 4fae198c..54e6d3f9 100644 --- a/coverage/control.py +++ b/coverage/control.py @@ -193,6 +193,8 @@ class coverage(object): if not filename.endswith(".py"): if filename[-4:-1] == ".py": filename = filename[:-1] + elif filename.endswith("$py.class"): # jython + filename = filename[:-9] + ".py" return filename def _should_trace(self, filename, frame): @@ -307,7 +309,7 @@ class coverage(object): self._warn("Module %s has no python source." % pkg) else: d, f = os.path.split(pkg_file) - if f.startswith('__init__.'): + if f.startswith('__init__'): # This is actually a package, return the directory. pkg_file = d else: -- cgit v1.2.1