# HG changeset patch # User Paul Boddie # Date 1484260179 -3600 # Node ID 0e7b5712a29b9cca0a174504d85179dce735cae3 # Parent b46f0224a6c49ee74f8d820696f157f31da65286 Raise an exception when a module is not found. diff -r b46f0224a6c4 -r 0e7b5712a29b importer.py --- a/importer.py Thu Jan 12 21:38:38 2017 +0100 +++ b/importer.py Thu Jan 12 23:29:39 2017 +0100 @@ -973,12 +973,10 @@ path_so_far.append(p) module_name = ".".join(path_so_far) - # Return None if the module could not be located. + # Raise an exception if the module could not be located. if not m: - if self.verbose: - print >>sys.stderr, "Not found (%s)" % name - return None + raise ProgramError("Module not found: %s" % name) # Get the directory and module filename.