Skip to content

Commit

Permalink
IOError → OSError (#1385)
Browse files Browse the repository at this point in the history
Starting from Python 3.3, IOError is an alias of OSError:
https://docs.python.org/3/library/exceptions.html#IOError
  • Loading branch information
DimitriPapadopoulos authored Oct 4, 2023
1 parent edf9b73 commit ae3017d
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions fsspec/implementations/zip.py
Original file line number Diff line number Diff line change
Expand Up @@ -113,10 +113,10 @@ def _open(
path = self._strip_protocol(path)
if "r" in mode and self.mode in set("wa"):
if self.exists(path):
raise IOError("ZipFS can only be open for reading or writing, not both")
raise OSError("ZipFS can only be open for reading or writing, not both")
raise FileNotFoundError(path)
if "r" in self.mode and "w" in mode:
raise IOError("ZipFS can only be open for reading or writing, not both")
raise OSError("ZipFS can only be open for reading or writing, not both")
out = self.zip.open(path, mode.strip("b"))
if "r" in mode:
info = self.info(path)
Expand Down

0 comments on commit ae3017d

Please sign in to comment.