summaryrefslogtreecommitdiffstats
path: root/Lib
diff options
context:
space:
mode:
authorAndrew Svetlov <andrew.svetlov@gmail.com>2012-12-09 22:03:55 (GMT)
committerAndrew Svetlov <andrew.svetlov@gmail.com>2012-12-09 22:03:55 (GMT)
commita6b292fbc76c784655d486db9b557734e7554833 (patch)
tree14d5c48796b1aaba5e1630d4819e48686cab0594 /Lib
parent0342688914108d4f24ca7ecf77b0326ee76641b0 (diff)
parent14857cf8fa34c46c514565764f91c6abeefc0829 (diff)
downloadcpython-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__.py6
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