Commits

Ned Batchelder  committed f96bbb6

A simpler way to get the package name

  • Participants
  • Parent commits ab1296f

Comments (0)

Files changed (1)

File coverage/xmlreport.py

 
         # Create the 'lines' and 'package' XML elements, which
         # are populated later.  Note that a package == a directory.
-        package_name, _ = ('.' + cu.name).rsplit('.', 1)
-        package_name = package_name[1:]
+        package_name = cu.name.rpartition(".")[0]
         className = cu.name
 
         package = self.packages.setdefault(package_name, [{}, 0, 0, 0, 0])