Skip to content

Commit a638f97

Browse files
committed
refactor(Lib/_pyio): use explicit exception for function
1 parent a395121 commit a638f97

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

Lib/_pyio.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1619,7 +1619,7 @@ def __init__(self, file, mode='r', closefd=True, opener=None):
16191619
except OSError as e:
16201620
if e.errno != errno.ESPIPE:
16211621
raise
1622-
except:
1622+
except (ValueError, TypeError, IsADirectoryError, OSError):
16231623
self._stat_atopen = None
16241624
if owned_fd is not None:
16251625
os.close(owned_fd)

0 commit comments

Comments
 (0)