diff options
author | Ned Batchelder <ned@nedbatchelder.com> | 2012-11-23 17:28:28 -0500 |
---|---|---|
committer | Ned Batchelder <ned@nedbatchelder.com> | 2012-11-23 17:28:28 -0500 |
commit | 730e8d616d8e11f7f024873c782df06a41cbdcf9 (patch) | |
tree | 3d7bebfc33344acd6f06695053bca52c9309a8ee | |
parent | 511222df132db2f60165788100596124aac1c2d5 (diff) | |
parent | 6c11dfddefa31121cb92a103296e133ad5c4d14f (diff) | |
download | python-coveragepy-730e8d616d8e11f7f024873c782df06a41cbdcf9.tar.gz |
Merged Geoff's change
-rw-r--r-- | coverage/codeunit.py | 2 | ||||
-rw-r--r-- | coverage/control.py | 4 |
2 files changed, 5 insertions, 1 deletions
diff --git a/coverage/codeunit.py b/coverage/codeunit.py index eb55489..2b581d0 100644 --- a/coverage/codeunit.py +++ b/coverage/codeunit.py @@ -54,6 +54,8 @@ class CodeUnit(object): # .pyc files should always refer to a .py instead. if f.endswith('.pyc') or f.endswith('.pyo'): f = f[:-1] + elif f.endswith('$py.class'): # jython + f = f[:-9] + ".py" self.filename = self.file_locator.canonical_filename(f) if hasattr(morf, '__name__'): diff --git a/coverage/control.py b/coverage/control.py index cee06ca..28d084b 100644 --- a/coverage/control.py +++ b/coverage/control.py @@ -189,6 +189,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): @@ -289,7 +291,7 @@ class coverage(object): pkg_file = None 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: |