Issue #16582: use int exit code in tkinter._exit

This commit is contained in:
Andrew Svetlov 2012-12-10 00:02:31 +02:00
parent 2e72831369
commit 806bfad457
1 changed files with 5 additions and 1 deletions

View File

@ -146,8 +146,12 @@ def _tkerror(err):
"""Internal function."""
pass
def _exit(code='0'):
def _exit(code=0):
"""Internal function. Calling it will throw the exception SystemExit."""
try:
code = int(code)
except ValueError:
pass
raise SystemExit(code)
_varnum = 0