diff options
author | Andrew Svetlov <andrew.svetlov@gmail.com> | 2012-12-09 22:03:55 (GMT) |
---|---|---|
committer | Andrew Svetlov <andrew.svetlov@gmail.com> | 2012-12-09 22:03:55 (GMT) |
commit | a6b292fbc76c784655d486db9b557734e7554833 (patch) | |
tree | 14d5c48796b1aaba5e1630d4819e48686cab0594 /Lib | |
parent | 0342688914108d4f24ca7ecf77b0326ee76641b0 (diff) | |
parent | 14857cf8fa34c46c514565764f91c6abeefc0829 (diff) | |
download | cpython-a6b292fbc76c784655d486db9b557734e7554833.zip cpython-a6b292fbc76c784655d486db9b557734e7554833.tar.gz cpython-a6b292fbc76c784655d486db9b557734e7554833.tar.bz2 |
Issue #16582: use int exit code in tkinter._exit
Diffstat (limited to 'Lib')
-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 0e7b96d..255f5b9 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 |