warnings.append(w)
return 0
except:
- w = Warning(self.moduleName, 1, sys.exc_info()[0] + " NOT PROCESSED UNABLE TO IMPORT")
+ exc_type, exc_value, exc_tb = sys.exc_info()
+ w = Warning(self.moduleName, 1, "%s: %s.\nUnable to import module %s." % (exc_type, exc_value, self.moduleName))
warnings.append(w)
importError(self.moduleName)
return 0
if callable(pre_process_cb) :
pre_process_cb(moduleName)
module = Module(moduleName, fullpath = filename)
-
+
+ # reload the given module, otherwise won't get new syntax errors.
+ sysModule = sys.modules.get(moduleName)
+ if sysModule:
+ try:
+ reload(sysModule)
+ except:
+ pass
+
module.load(warnings)
utils.popConfig()
return warnings
_cfg, files, suppressions = Config.setupFromArgs([filename])
if not files :
return 0
-
+
global _output, _statusDlg, _count
_output = messageView
# wxBug: Need to show progress dialog box, or message window never gets updated until the method returns
_count = 0
# insert this here, so we find files in the local dir before std library
- sys.path.insert(0, '')
+ if sys.path[0] != '' :
+ sys.path.insert(0, '')
importWarnings = processFiles(files, _cfg, _print_processing)
fixupBuiltinModules()