summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-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