Merge pull request #829 from cjmayo/oserror

Replace os.error
This commit is contained in:
Chris Mayo 2024-08-27 19:29:39 +01:00 committed by GitHub
commit b77e39f26b
No known key found for this signature in database
GPG key ID: B5690EEEBB952194

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