{"action":"created","issue":{"url":"https://api.github.com/repos/spyder-ide/spyder/issues/1974","labels_url":"https://api.github.com/repos/spyder-ide/spyder/issues/1974/labels{/name}","comments_url":"https://api.github.com/repos/spyder-ide/spyder/issues/1974/comments","events_url":"https://api.github.com/repos/spyder-ide/spyder/issues/1974/events","html_url":"https://github.com/spyder-ide/spyder/issues/1974","id":57983635,"number":1974,"title":"exit() lets the kernel die","user":{"login":"spyder-issues-migrator","id":11021581,"avatar_url":"https://avatars.githubusercontent.com/u/11021581?v=3","gravatar_id":"","url":"https://api.github.com/users/spyder-issues-migrator","html_url":"https://github.com/spyder-issues-migrator","followers_url":"https://api.github.com/users/spyder-issues-migrator/followers","following_url":"https://api.github.com/users/spyder-issues-migrator/following{/other_user}","gists_url":"https://api.github.com/users/spyder-issues-migrator/gists{/gist_id}","starred_url":"https://api.github.com/users/spyder-issues-migrator/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/spyder-issues-migrator/subscriptions","organizations_url":"https://api.github.com/users/spyder-issues-migrator/orgs","repos_url":"https://api.github.com/users/spyder-issues-migrator/repos","events_url":"https://api.github.com/users/spyder-issues-migrator/events{/privacy}","received_events_url":"https://api.github.com/users/spyder-issues-migrator/received_events","type":"User","site_admin":false},"labels":[{"url":"https://api.github.com/repos/spyder-ide/spyder/labels/1%20star","name":"1 star","color":"FFFFFF"},{"url":"https://api.github.com/repos/spyder-ide/spyder/labels/bug","name":"bug","color":"fc2929"},{"url":"https://api.github.com/repos/spyder-ide/spyder/labels/done","name":"done","color":"FFFFFF"},{"url":"https://api.github.com/repos/spyder-ide/spyder/labels/imported","name":"imported","color":"FFFFFF"}],"state":"open","locked":false,"assignee":null,"milestone":null,"comments":5,"created_at":"2015-02-17T21:18:04Z","updated_at":"2015-02-17T21:18:07Z","closed_at":null,"body":"_From [robert.p...@mykolab.com](https://code.google.com/u/113841535926527526275/) on 2014-09-19T02:23:28Z_\n\nI hope this is the right issue tracker for my problem:\r\n\r\nI am using WinPython. When I am creating a new script with the command exit(), and run it within Spyder, this command kills the kernel:\r\n\r\n\"\"\"\r\nIt seems the kernel died unexpectedly. Use 'Restart kernel' to continue using this console.\r\n\"\"\"\r\n\r\nWhat's the right way to stop a script in this runtime environment?\r\n\r\nMy workaround so far is to encapsulate the code into a 'main' function and use 'return' inside.\n\n_Original issue: http://code.google.com/p/spyderlib/issues/detail?id=1974_"},"comment":{"url":"https://api.github.com/repos/spyder-ide/spyder/issues/comments/74755898","html_url":"https://github.com/spyder-ide/spyder/issues/1974#issuecomment-74755898","issue_url":"https://api.github.com/repos/spyder-ide/spyder/issues/1974","id":74755898,"user":{"login":"spyder-issues-migrator","id":11021581,"avatar_url":"https://avatars.githubusercontent.com/u/11021581?v=3","gravatar_id":"","url":"https://api.github.com/users/spyder-issues-migrator","html_url":"https://github.com/spyder-issues-migrator","followers_url":"https://api.github.com/users/spyder-issues-migrator/followers","following_url":"https://api.github.com/users/spyder-issues-migrator/following{/other_user}","gists_url":"https://api.github.com/users/spyder-issues-migrator/gists{/gist_id}","starred_url":"https://api.github.com/users/spyder-issues-migrator/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/spyder-issues-migrator/subscriptions","organizations_url":"https://api.github.com/users/spyder-issues-migrator/orgs","repos_url":"https://api.github.com/users/spyder-issues-migrator/repos","events_url":"https://api.github.com/users/spyder-issues-migrator/events{/privacy}","received_events_url":"https://api.github.com/users/spyder-issues-migrator/received_events","type":"User","site_admin":false},"created_at":"2015-02-17T21:18:05Z","updated_at":"2015-02-17T21:18:05Z","body":"_From [contrebasse](https://code.google.com/u/contrebasse/) on 2014-09-19T02:11:49Z_\n\nexit() is used to terminate python, so this is the intended behavior: https://docs.python.org/2/library/sys.html#sys.exit You can also put your code inside a \"if\" block, but using functions is generally the right thing to do."}}