Improve reporting of Python exceptions

This commit is contained in:
wmayer
2013-05-04 14:23:53 +02:00
parent 2bbe465229
commit 946bd02df4
12 changed files with 58 additions and 56 deletions

View File

@@ -1228,9 +1228,10 @@ void Application::processCmdLineFiles(void)
Base::Interpreter().runFile(File.filePath().c_str(), true);
}
else if (File.hasExtension("py")) {
try{
try {
Base::Interpreter().loadModule(File.fileNamePure().c_str());
}catch(PyException){
}
catch(const PyException&) {
// if module load not work, just try run the script (run in __main__)
Base::Interpreter().runFile(File.filePath().c_str(),true);
}