Ensure filename is shown when an exception occurs in a dropped Py script

This commit is contained in:
Nyall Dawson 2024-04-12 10:59:43 +10:00
parent 3ac4fd4ca8
commit 3688035942

View File

@ -976,7 +976,8 @@ def processing_algorithm_from_script(filepath: str):
}
with open(filename.encode(sys.getfilesystemencoding())) as input_file:
exec(input_file.read(), _locals)
code_object = compile(input_file.read(), filename, 'exec')
exec(code_object, _locals)
alg_instance = None
try:
alg_instance = alg.instances.pop().createInstance()