Skip to content

Commit

Permalink
Remove IOError
Browse files Browse the repository at this point in the history
Since Python 3.3 IOError is an alias of OSError and is kept for
compatibility. No longer needed since the project supports
only bigger Python versions.

Signed-off-by: Teodora Sechkova <tsechkova@vmware.com>
  • Loading branch information
sechkova committed Jun 3, 2021
1 parent 66bb601 commit 32ab712
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions securesystemslib/storage.py
Original file line number Diff line number Diff line change
Expand Up @@ -200,7 +200,7 @@ def get(self, filepath:str) -> Generator[BinaryIO, None, None]:
try:
file_object = open(filepath, 'rb')
yield file_object
except (FileNotFoundError, IOError):
except OSError:
raise exceptions.StorageError(
"Can't open %s" % filepath)
finally:
Expand All @@ -221,7 +221,7 @@ def put(self, fileobj: IO, filepath: str) -> None:
# and the operating system's buffers. os.fsync() should follow flush().
destination_file.flush()
os.fsync(destination_file.fileno())
except (OSError, IOError):
except OSError:
raise exceptions.StorageError(
"Can't write file %s" % filepath)

Expand Down

0 comments on commit 32ab712

Please sign in to comment.