projects
/
wxWidgets.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
applied patch 1372197, with some minor mods and cleanup
[wxWidgets.git]
/
wxPython
/
samples
/
ide
/
activegrid
/
tool
/
checker.py
diff --git
a/wxPython/samples/ide/activegrid/tool/checker.py
b/wxPython/samples/ide/activegrid/tool/checker.py
index 985222a1dc897707d39caaa72100263da845ce6b..23b437272770949316bc0a16c324ccd9bddd7aeb 100644
(file)
--- 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:
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
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)
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
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
_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
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
_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()
importWarnings = processFiles(files, _cfg, _print_processing)
fixupBuiltinModules()