# HG changeset patch # User Paul Boddie # Date 1481044322 -3600 # Node ID 959c65c586e8c918ce12c940916a31d01e44444d # Parent 7ce269cf45391ef3a5efb817ad3d279f3e05e04e Do not load modules while descending into packages. diff -r 7ce269cf4539 -r 959c65c586e8 importer.py --- a/importer.py Tue Dec 06 17:55:55 2016 +0100 +++ b/importer.py Tue Dec 06 18:12:02 2016 +0100 @@ -774,18 +774,20 @@ path_so_far.append(p) module_name = ".".join(path_so_far) + # Return None if the module could not be located. + if not m: if self.verbose: print >>sys.stderr, "Not found (%s)" % name + return None - return None # NOTE: Import error. - - # Get the module itself. + # Get the directory and module filename. d, filename = m - module = self.load_from_file(filename, module_name) - return module + # Get the module itself. + + return self.load_from_file(filename, module_name) def load_from_file(self, filename, module_name=None):