diff options
author | Geoff Bache <devnull@localhost> | 2010-12-10 21:34:14 +0100 |
---|---|---|
committer | Geoff Bache <devnull@localhost> | 2010-12-10 21:34:14 +0100 |
commit | 6c11dfddefa31121cb92a103296e133ad5c4d14f (patch) | |
tree | d68b601babeb9cdc458368f8d38fa82c8898efed /coverage/control.py | |
parent | 24567ee88042326542fff3e86c183c63576e64d1 (diff) | |
download | python-coveragepy-6c11dfddefa31121cb92a103296e133ad5c4d14f.tar.gz |
Handle compiled files under Jython
Diffstat (limited to 'coverage/control.py')
-rw-r--r-- | coverage/control.py | 4 |
1 files changed, 3 insertions, 1 deletions
diff --git a/coverage/control.py b/coverage/control.py index 4fae198..54e6d3f 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: |