[issue26949] IDLE restarts when one debugs code raising SystemExit

Louie Lu report at bugs.python.org
Mon May 22 02:37:23 EDT 2017


Louie Lu added the comment:

The problem is cause by run.py:main function, when it catch KeyboardInterrupt or SystemExit, it won't put a blank msg back to response_queue, that cause the loop in run.py:main triggering except queue.Empty to continue the loop.



So, I think the KeyboardInterrupt hang is a bug, cause by the infinity loop above, but SystemExit will raise SystemExit again, and break down the loop, let the shell restart. I think this isn't a bug.

Let's say there is a code like this:

    x = 10
    print(x)
    raise SystemExit
    print(x)

When using IDLE to run this file without debugger, it will print 10 and leave below code. But when you type "x" in the shell, it will pop up 10, that means the shell environment didn't exit, still exist inside.

But if you open the debugger, let SystemExit break the loop and restart the shell, I think this is a normal behavior -- that it should exit the shell (and restart it)

----------
nosy: +louielu

_______________________________________
Python tracker <report at bugs.python.org>
<http://bugs.python.org/issue26949>
_______________________________________


More information about the Python-bugs-list mailing list