diff options
Diffstat (limited to 'embroider_print.py')
| -rw-r--r-- | embroider_print.py | 19 |
1 files changed, 15 insertions, 4 deletions
diff --git a/embroider_print.py b/embroider_print.py index 2aa76ec6..0dbff929 100644 --- a/embroider_print.py +++ b/embroider_print.py @@ -363,7 +363,18 @@ class Print(InkstitchExtension): if __name__ == '__main__': - #save_stderr() - effect = Print() - effect.affect() - #restore_stderr() + exception = None + + save_stderr() + try: + effect = Print() + effect.affect() + except: + exception = traceback.format_exc() + restore_stderr() + + if exception: + print >> sys.stderr, exception + sys.exit(1) + else: + sys.exit(0) |
