mirror of
https://gerrit.googlesource.com/git-repo
synced 2025-06-26 20:17:52 +00:00
cleanup: convert exceptions to OSError
In Python 3, these exceptions were merged into OSError, so switch everything over to that. Change-Id: If876a28b692de5aa5c62a3bdc8c000793ce52c63 Reviewed-on: https://gerrit-review.googlesource.com/c/git-repo/+/390376 Reviewed-by: Aravind Vasudevan <aravindvasudev@google.com> Commit-Queue: Mike Frysinger <vapier@google.com> Tested-by: Mike Frysinger <vapier@google.com>
This commit is contained in:
10
project.py
10
project.py
@ -431,7 +431,7 @@ class _CopyFile:
|
||||
mode = os.stat(dest)[stat.ST_MODE]
|
||||
mode = mode & ~(stat.S_IWUSR | stat.S_IWGRP | stat.S_IWOTH)
|
||||
os.chmod(dest, mode)
|
||||
except IOError:
|
||||
except OSError:
|
||||
logger.error("error: Cannot copy file %s to %s", src, dest)
|
||||
|
||||
|
||||
@ -466,7 +466,7 @@ class _LinkFile:
|
||||
if not platform_utils.isdir(dest_dir):
|
||||
os.makedirs(dest_dir)
|
||||
platform_utils.symlink(relSrc, absDest)
|
||||
except IOError:
|
||||
except OSError:
|
||||
logger.error(
|
||||
"error: Cannot link file %s to %s", relSrc, absDest
|
||||
)
|
||||
@ -1198,7 +1198,7 @@ class Project:
|
||||
with tarfile.open(tarpath, "r") as tar:
|
||||
tar.extractall(path=path)
|
||||
return True
|
||||
except (IOError, tarfile.TarError) as e:
|
||||
except (OSError, tarfile.TarError) as e:
|
||||
logger.error("error: Cannot extract archive %s: %s", tarpath, e)
|
||||
return False
|
||||
|
||||
@ -1309,7 +1309,7 @@ class Project:
|
||||
alt_dir = os.path.join(
|
||||
self.objdir, "objects", fd.readline().rstrip()
|
||||
)
|
||||
except IOError:
|
||||
except OSError:
|
||||
alt_dir = None
|
||||
else:
|
||||
alt_dir = None
|
||||
@ -3584,7 +3584,7 @@ class Project:
|
||||
try:
|
||||
with open(path) as fd:
|
||||
line = fd.readline()
|
||||
except IOError as e:
|
||||
except OSError as e:
|
||||
raise NoManifestException(path, str(e))
|
||||
try:
|
||||
line = line.decode()
|
||||
|
Reference in New Issue
Block a user