diff options
author | Irit Katriel <1055913+iritkatriel@users.noreply.github.com> | 2023-03-31 10:23:02 (GMT) |
---|---|---|
committer | GitHub <noreply@github.com> | 2023-03-31 10:23:02 (GMT) |
commit | 44bd3fe570da9115bec67694404b8da26716a1d7 (patch) | |
tree | f6280db95a581e4363bc6c2dfde592b932f3cd07 /Lib/tkinter | |
parent | c1e71ce56fdb3eab62ad3190d09130f800e54610 (diff) | |
download | cpython-44bd3fe570da9115bec67694404b8da26716a1d7.zip cpython-44bd3fe570da9115bec67694404b8da26716a1d7.tar.gz cpython-44bd3fe570da9115bec67694404b8da26716a1d7.tar.bz2 |
gh-102799: use exception instance instead of sys.exc_info() (#102885)
Diffstat (limited to 'Lib/tkinter')
-rw-r--r-- | Lib/tkinter/filedialog.py | 5 |
1 files changed, 2 insertions, 3 deletions
diff --git a/Lib/tkinter/filedialog.py b/Lib/tkinter/filedialog.py index 600d0bd..e2eff98 100644 --- a/Lib/tkinter/filedialog.py +++ b/Lib/tkinter/filedialog.py @@ -461,7 +461,6 @@ def test(): # Start off with UTF-8 enc = "utf-8" - import sys # See whether CODESET is defined try: @@ -477,9 +476,9 @@ def test(): try: fp=open(openfilename,"r") fp.close() - except: + except BaseException as exc: print("Could not open File: ") - print(sys.exc_info()[1]) + print(exc) print("open", openfilename.encode(enc)) |