mirror of
https://github.com/python/cpython.git
synced 2025-11-01 22:21:35 +00:00
gh-102799: use exception instance instead of sys.exc_info() (#102885)
This commit is contained in:
parent
c1e71ce56f
commit
44bd3fe570
7 changed files with 16 additions and 17 deletions
|
|
@ -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))
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue