summaryrefslogtreecommitdiffstats
path: root/Lib/tkinter
diff options
context:
space:
mode:
authorAndrew Svetlov <andrew.svetlov@gmail.com>2012-12-09 22:02:31 (GMT)
committerAndrew Svetlov <andrew.svetlov@gmail.com>2012-12-09 22:02:31 (GMT)
commit806bfad45749f25f9d6ac1622598d348297e127b (patch)
treec3bf2b8541eba6d8d5c048ad46fb60659084305f /Lib/tkinter
parent2e72831369b8e6239757c1b20af417e2746a151f (diff)
downloadcpython-806bfad45749f25f9d6ac1622598d348297e127b.zip
cpython-806bfad45749f25f9d6ac1622598d348297e127b.tar.gz
cpython-806bfad45749f25f9d6ac1622598d348297e127b.tar.bz2
Issue #16582: use int exit code in tkinter._exit
Diffstat (limited to 'Lib/tkinter')
-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 67a2f9a..7073662 100644
--- a/Lib/tkinter/__init__.py
+++ b/Lib/tkinter/__init__.py
@@ -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