Message370594
Yes, the patch by Terry Reedy fixes this issue while still breaking the loop from `def f: pass`.
It will start the debugger once for `def f: pass` which may be weird as in this case no user code has been executed and it will be in bdb which may confuse users:
Traceback (most recent call last):
File "/Users/remi/src/cpython/Lib/pdb.py", line 1703, in main
pdb._runscript(mainpyfile)
File "/Users/remi/src/cpython/Lib/pdb.py", line 1572, in _runscript
self.run(statement)
File "/Users/remi/src/cpython/Lib/bdb.py", line 580, in run
exec(cmd, globals, locals)
File "<string>", line 1, in <module>
File "/Users/remi/src/cpython/tests.py", line 1
def f: pass
^
SyntaxError: invalid syntax
Uncaught exception. Entering post mortem debugging
Running 'cont' or 'step' will restart the program
> <string>(1)<module>()
(Pdb) bt
/Users/remi/src/cpython/Lib/pdb.py(1703)main()
-> pdb._runscript(mainpyfile)
/Users/remi/src/cpython/Lib/pdb.py(1572)_runscript()
-> self.run(statement)
/Users/remi/src/cpython/Lib/bdb.py(580)run()
-> exec(cmd, globals, locals)
> <string>(1)<module>()
Perhaps we should should test whether the exception happened there and not drop in the debugger in that case? |
|
Date |
User |
Action |
Args |
2020-06-02 07:42:52 | remi.lapeyre | set | recipients:
+ remi.lapeyre, terry.reedy, xdegaye, Kerrick Staley |
2020-06-02 07:42:52 | remi.lapeyre | set | messageid: <1591083772.59.0.356120153538.issue40403@roundup.psfhosted.org> |
2020-06-02 07:42:52 | remi.lapeyre | link | issue40403 messages |
2020-06-02 07:42:52 | remi.lapeyre | create | |
|