Commits

David Stanek  committed 95fd09a

fixed an error where not specifying the cover package would cause a traceback

  • Participants
  • Parent commits ef23e0e

Comments (0)

Files changed (1)

File coverage/testplugin.py

         self.coverage.stop()
         self.coverage.save()
 
-        modules = [module
-                for name, module in sys.modules.items()
-                if module is not None and name.startswith(self.coverPackage)]
-        
+        modules = []
+        if self.coverPackage:
+            for name, module in sys.modules.items():
+                if module is not None and name.startswith(self.coverPackage):
+                    modules.append(module)
+
         # Remaining actions are reporting, with some common self.options.
         report_args = {
             'morfs': modules,