Commits

Ned Batchelder committed ed1efe7 Merge

Merged Geoff's change

  • Participants
  • Parent commits e8696f8, df42cb1

Comments (0)

Files changed (2)

coverage/codeunit.py

         # .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__'):

coverage/control.py

         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):
                     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: