Replace os.error

os.error is an alias for OSError.
This commit is contained in:
Chris Mayo 2024-08-27 19:26:46 +01:00
parent b31eec21a4
commit cd67cb4a78

View file

@ -45,7 +45,7 @@ def get_mtime(filename):
"""Return modification time of filename or zero on errors."""
try:
return os.path.getmtime(filename)
except os.error:
except OSError:
return 0
@ -53,7 +53,7 @@ def get_size(filename):
"""Return file size in Bytes, or -1 on error."""
try:
return os.path.getsize(filename)
except os.error:
except OSError:
return -1