summaryrefslogtreecommitdiffstats
path: root/Lib/tkinter
diff options
context:
space:
mode:
authorIrit Katriel <1055913+iritkatriel@users.noreply.github.com>2023-03-31 10:23:02 (GMT)
committerGitHub <noreply@github.com>2023-03-31 10:23:02 (GMT)
commit44bd3fe570da9115bec67694404b8da26716a1d7 (patch)
treef6280db95a581e4363bc6c2dfde592b932f3cd07 /Lib/tkinter
parentc1e71ce56fdb3eab62ad3190d09130f800e54610 (diff)
downloadcpython-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.py5
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))