Message370579
This is related to issue 16180, it may be possible to improve the situation by trying to determine whether the SyntaxError is in the file or came during its execution by looking at the filename but it's probably very brittle:
# In most cases SystemExit does not warrant a post-mortem session.
print("The program exited via sys.exit(). Exit status:", end=' ')
print(sys.exc_info()[1])
- except SyntaxError:
- traceback.print_exc()
- sys.exit(1)
- except:
+ except Exception as e:
+ if (type(e) is SyntaxError and
+ e.filename == os.path.abspath(mainpyfile)):
+ traceback.print_exc()
+ sys.exit(1)
traceback.print_exc()
print("Uncaught exception. Entering post mortem debugging")
print("Running 'cont' or 'step' will restart the program") |
|
Date |
User |
Action |
Args |
2020-06-01 21:00:05 | remi.lapeyre | set | recipients:
+ remi.lapeyre, terry.reedy, xdegaye, Kerrick Staley |
2020-06-01 21:00:05 | remi.lapeyre | set | messageid: <1591045205.86.0.523577876494.issue40403@roundup.psfhosted.org> |
2020-06-01 21:00:05 | remi.lapeyre | link | issue40403 messages |
2020-06-01 21:00:05 | remi.lapeyre | create | |
|