From: Andrew Svetlov Date: Sun, 9 Dec 2012 22:02:31 +0000 (+0200) Subject: Issue #16582: use int exit code in tkinter._exit X-Git-Tag: v3.3.1rc1~547^2 X-Git-Url: https://granicus.if.org/sourcecode?a=commitdiff_plain;h=806bfad45749f25f9d6ac1622598d348297e127b;p=python Issue #16582: use int exit code in tkinter._exit --- diff --git a/Lib/tkinter/__init__.py b/Lib/tkinter/__init__.py index 67a2f9a327..70736623a1 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