[GH-ISSUE #49] exit() not available #47

Closed
opened 2026-02-26 12:20:18 +03:00 by kerem · 3 comments
Owner

Originally created by @ghost on GitHub (Mar 4, 2019).
Original GitHub issue: https://github.com/brentvollebregt/auto-py-to-exe/issues/49

I have an exit() in my script and it crashes with:
NameError: name 'exit' is not defined
[15088] Failed to execute script main

Please help

BTW Sorry for the CAPS TITLE._.

Originally created by @ghost on GitHub (Mar 4, 2019). Original GitHub issue: https://github.com/brentvollebregt/auto-py-to-exe/issues/49 I have an exit() in my script and it crashes with: NameError: name 'exit' is not defined [15088] Failed to execute script main Please help BTW Sorry for the CAPS TITLE._.
kerem closed this issue 2026-02-26 12:20:18 +03:00
Author
Owner

@brentvollebregt commented on GitHub (Mar 5, 2019):

If you do some searching, you will find articles like this and this that explain briefly what exit is and why you should be using sys.exit().

If you do feel this is a bug though, it will be directly related to PyInstaller so you will need to raise an issue over there. The reason this is not linked to auto-py-to-exe is that I do not inject any code into the executables produced as that can potentially be dangerous in terms of setting things up in an unpredictable way and general security.

<!-- gh-comment-id:469492848 --> @brentvollebregt commented on GitHub (Mar 5, 2019): If you do some searching, you will find articles like [this](https://stackoverflow.com/questions/6501121/difference-between-exit-and-sys-exit-in-python) and [this](https://stackoverflow.com/questions/19747371/python-exit-commands-why-so-many-and-when-should-each-be-used) that explain briefly what `exit` is and why you should be using `sys.exit()`. If you do feel this is a bug though, it will be directly related to PyInstaller so you will need to raise an issue [over there](https://github.com/pyinstaller/pyinstaller/issues). The reason this is not linked to auto-py-to-exe is that I do not inject any code into the executables produced as that can potentially be dangerous in terms of setting things up in an unpredictable way and general security.
Author
Owner

@ghost commented on GitHub (Mar 5, 2019):

Thanks.
I could bypass the problem with os.abort().

<!-- gh-comment-id:469694190 --> @ghost commented on GitHub (Mar 5, 2019): Thanks. I could bypass the problem with os.abort().
Author
Owner

@brentvollebregt commented on GitHub (Mar 6, 2019):

Cool. Importing sys and calling sys.exit() will produce the exact same exception and result as exit.

Closing due to this being resolved.

<!-- gh-comment-id:469915366 --> @brentvollebregt commented on GitHub (Mar 6, 2019): Cool. Importing sys and calling `sys.exit()` will produce the exact same exception and result as `exit`. Closing due to this being resolved.
Sign in to join this conversation.
No milestone
No project
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set.

Reference
starred/auto-py-to-exe#47
No description provided.