diff options
author | Andrew Svetlov <andrew.svetlov@gmail.com> | 2012-12-09 22:03:39 (GMT) |
---|---|---|
committer | Andrew Svetlov <andrew.svetlov@gmail.com> | 2012-12-09 22:03:39 (GMT) |
commit | 14857cf8fa34c46c514565764f91c6abeefc0829 (patch) | |
tree | 255fcdee62b20d8c699a7e30143e422784912cb2 /Lib/tkinter | |
parent | 50cdd55af9529dee95e71a89741d942d06e3c4b8 (diff) | |
parent | 806bfad45749f25f9d6ac1622598d348297e127b (diff) | |
download | cpython-14857cf8fa34c46c514565764f91c6abeefc0829.zip cpython-14857cf8fa34c46c514565764f91c6abeefc0829.tar.gz cpython-14857cf8fa34c46c514565764f91c6abeefc0829.tar.bz2 |
Issue #16582: use int exit code in tkinter._exit
Diffstat (limited to 'Lib/tkinter')
-rw-r--r-- | Lib/tkinter/__init__.py | 6 |
1 files changed, 5 insertions, 1 deletions
diff --git a/Lib/tkinter/__init__.py b/Lib/tkinter/__init__.py index 0ef62de..7e5b915 100644 --- a/Lib/tkinter/__init__.py +++ b/Lib/tkinter/__init__.py @@ -148,8 +148,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 |