Skip to content

Commit ee756ec

Browse files
committed
debug: print full traceback in subprocess
1 parent 812e9e8 commit ee756ec

1 file changed

Lines changed: 4 additions & 2 deletions

File tree

‎python/grass/pygrass/modules/tests/grass_pygrass_grid_test.py‎

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -24,7 +24,10 @@ def _run_grid_module(module_name, project, run_kwargs=None, **kwargs):
2424
grid = GridModule(module_name, **kwargs)
2525
grid.run(**run_kwargs)
2626
except Exception as e:
27-
print(f"GridModule failed: {e}", file=sys.stderr)
27+
import traceback
28+
29+
traceback.print_exc()
30+
print("GridModule failed: " + str(e), file=sys.stderr)
2831
sys.exit(1)
2932

3033

@@ -45,7 +48,6 @@ def run_in_subprocess(function, check=True):
4548
process = ctx.Process(target=function)
4649
process.start()
4750
process.join()
48-
print(f"Worker exitcode: {process.exitcode}", flush=True)
4951
if check and process.exitcode != 0:
5052
msg = f"Subprocess failed with exit code {process.exitcode}"
5153
raise RuntimeError(msg)

0 commit comments

Comments
 (0)