X-Git-Url: https://git.saurik.com/wxWidgets.git/blobdiff_plain/1f780e48af479e7bf9a07eaaa1ab6b41f1ffb17b..26ee3a06e28e16b71367183581a4f3b10ee4e832:/wxPython/samples/ide/activegrid/tool/checker.py?ds=inline diff --git a/wxPython/samples/ide/activegrid/tool/checker.py b/wxPython/samples/ide/activegrid/tool/checker.py index 985222a1dc..23b4372727 100644 --- a/wxPython/samples/ide/activegrid/tool/checker.py +++ b/wxPython/samples/ide/activegrid/tool/checker.py @@ -594,7 +594,8 @@ class Module : 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 @@ -720,7 +721,15 @@ def processFiles(files, cfg = None, pre_process_cb = None) : 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 @@ -748,7 +757,7 @@ def checkSyntax(filename, messageView): _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 @@ -756,7 +765,8 @@ def checkSyntax(filename, messageView): _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()