Issue
I'm running a simulation in pygame, where clicking on close button triggers sys.exit()
. If I run it from command prompt then all is nice and well. If I try to run the script from Spyder everything works fine until I click on close button:
An exception has occurred, use %tb to see the full traceback.
SystemExit
C:\ProgramData\Anaconda3\lib\site-packages\IPython\core\interactiveshell.py:2971: UserWarning: To exit: use 'exit', 'quit', or Ctrl-D.
warn("To exit: use 'exit', 'quit', or Ctrl-D.", stacklevel=1)
Kernel died, restarting
After this the sim window becomes unresponsive and I have to manually kill it. The same issue has happened previously as well when I ran tkinter-based scripts from Spyder and closed window by clicking on X.
I had a look around but couldn't find a solution either here or on Spyder's github page. Does anyone know what's causing it?
EDIT: Just tested - if I just do in the console:
import sys
sys.exit()
I get the same warning, but kernel doesn't crash.
Solution
(Spyder maintainer here) This will no longer be an issue in Spyder 4, to be released later in this month (November 2019).
Answered By - Carlos Cordoba
0 comments:
Post a Comment
Note: Only a member of this blog may post a comment.