Improve reporting of Python exceptions
This commit is contained in:
@@ -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);
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user