@@ -152,9 +152,14 @@ def process_xml_file(self, xml_file):
152152 for source in root [0 ]:
153153 # keep track of number of times we use each source_path to find
154154 # some file. Unused source paths are likely a problem.
155- source_paths .append ([source .text , 0 ])
156155 if self ._args .verbose :
157- print ("source: " + source .text )
156+ print ("source: '%s'" % (source .text ))
157+ # unclear why the Coverage.py version on GitHub node
158+ # generates empty sources
159+ if source .text == None :
160+ print ("skipping empty source (???)" )
161+ continue
162+ source_paths .append ([source .text , 0 ])
158163 else :
159164 print ("Error: parse xml fail: no 'sources' in %s" % (xml_file ))
160165 sys .exit (1 )
@@ -174,17 +179,24 @@ def process_xml_file(self, xml_file):
174179 # name="." means current directory
175180 # name=".folder1.folder2" means external module or directory
176181 # name="abc" means internal module or directory
177- isExternal = (package .attrib ['name' ].startswith ('.' ) and package .attrib ['name' ] != '.' )
182+ pname = package .attrib ['name' ]
183+ if self ._args .verbose :
184+ print ("package: '%s'" % (pname ))
185+ isExternal = (pname .startswith ('.' ) and pname != '.' )
178186 #pdb.set_trace()
179187 for classes in package :
180188 for fileNode in classes :
181- if self ._args .excludePatterns and any ([fnmatch .fnmatchcase (fileNode .attrib ['filename' ], ef ) for ef in self ._excludePatterns ]):
189+ name = fileNode .attrib ['filename' ]
190+ if self ._args .excludePatterns and any ([fnmatch .fnmatchcase (name , ef ) for ef in self ._excludePatterns ]):
182191 if self ._args .verbose :
183- print ("%s is excluded" % fileNode . attrib [ 'filename' ] )
192+ print ("%s is excluded" % name )
184193 continue
185- name = fileNode .attrib ['filename' ]
194+ if self ._args .verbose > 1 :
195+ print (" file: %s" % (name ))
186196 if not isExternal :
187197 for s in source_paths :
198+ if self ._args .verbose > 1 :
199+ print (" check src_path (%s %d)" % (s [0 ], s [1 ]))
188200 path = os .path .join (s [0 ], name )
189201 if os .path .exists (path ):
190202 name = path
0 commit comments