diff options
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 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 |