Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Commit 806bfad

Browse files
committed
Issue #16582: use int exit code in tkinter._exit
1 parent 2e72831 commit 806bfad

1 file changed

Lines changed: 5 additions & 1 deletion

File tree

Lib/tkinter/__init__.py

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -146,8 +146,12 @@ def _tkerror(err):
146146
"""Internal function."""
147147
pass
148148

149-
def _exit(code='0'):
149+
def _exit(code=0):
150150
"""Internal function. Calling it will throw the exception SystemExit."""
151+
try:
152+
code = int(code)
153+
except ValueError:
154+
pass
151155
raise SystemExit(code)
152156

153157
_varnum = 0

0 commit comments

Comments
 (0)