While doing python scripting on Ubuntu 16.04 with photoscan 1.4.1, I've noticed photoscan.sh always returns 0 even when my script raises an exception. My solution is to explicitly call sys.exit(1) within my script, which causes photoscan.sh to return 1. But I'm not sure if it's safe to call sys.exit directly--does this prevent PhotoScan from cleaning up?
To be precise, here are two example scripts:
test_a.py:
raise RuntimeError("error!")
test_b.py:
import sys
sys.exit(1)
...and when I run them:
python test_a.py # returns 1
photoscan.sh -platform offscreen -r test_a.py # returns 0
python test_b.py # returns 1
photoscan.sh -platform offscreen -r test_b.py # returns 1