summaryrefslogtreecommitdiffstats
path: root/project.py
diff options
context:
space:
mode:
authorJason R. Coombs <jaraco@jaraco.com>2023-10-20 23:32:40 +0545
committerLUCI <gerrit-scoped@luci-project-accounts.iam.gserviceaccount.com>2023-10-21 00:56:10 +0000
commitae824fb2fc2770c84cc34c1956e4c76c8c972860 (patch)
tree4f8ec44e29c7401b99b3aef1b28a2104a0a86221 /project.py
parent034950b9eebacd6598ea518a0b254845bc806ab6 (diff)
downloadgit-repo-ae824fb2fc2770c84cc34c1956e4c76c8c972860.tar.gz
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>
Diffstat (limited to 'project.py')
-rw-r--r--project.py10
1 files changed, 5 insertions, 5 deletions
diff --git a/project.py b/project.py
index 5c9f31cf..be53defd 100644
--- a/project.py
+++ b/project.py
@@ -431,7 +431,7 @@ class _CopyFile:
431 mode = os.stat(dest)[stat.ST_MODE] 431 mode = os.stat(dest)[stat.ST_MODE]
432 mode = mode & ~(stat.S_IWUSR | stat.S_IWGRP | stat.S_IWOTH) 432 mode = mode & ~(stat.S_IWUSR | stat.S_IWGRP | stat.S_IWOTH)
433 os.chmod(dest, mode) 433 os.chmod(dest, mode)
434 except IOError: 434 except OSError:
435 logger.error("error: Cannot copy file %s to %s", src, dest) 435 logger.error("error: Cannot copy file %s to %s", src, dest)
436 436
437 437
@@ -466,7 +466,7 @@ class _LinkFile:
466 if not platform_utils.isdir(dest_dir): 466 if not platform_utils.isdir(dest_dir):
467 os.makedirs(dest_dir) 467 os.makedirs(dest_dir)
468 platform_utils.symlink(relSrc, absDest) 468 platform_utils.symlink(relSrc, absDest)
469 except IOError: 469 except OSError:
470 logger.error( 470 logger.error(
471 "error: Cannot link file %s to %s", relSrc, absDest 471 "error: Cannot link file %s to %s", relSrc, absDest
472 ) 472 )
@@ -1198,7 +1198,7 @@ class Project:
1198 with tarfile.open(tarpath, "r") as tar: 1198 with tarfile.open(tarpath, "r") as tar:
1199 tar.extractall(path=path) 1199 tar.extractall(path=path)
1200 return True 1200 return True
1201 except (IOError, tarfile.TarError) as e: 1201 except (OSError, tarfile.TarError) as e:
1202 logger.error("error: Cannot extract archive %s: %s", tarpath, e) 1202 logger.error("error: Cannot extract archive %s: %s", tarpath, e)
1203 return False 1203 return False
1204 1204
@@ -1309,7 +1309,7 @@ class Project:
1309 alt_dir = os.path.join( 1309 alt_dir = os.path.join(
1310 self.objdir, "objects", fd.readline().rstrip() 1310 self.objdir, "objects", fd.readline().rstrip()
1311 ) 1311 )
1312 except IOError: 1312 except OSError:
1313 alt_dir = None 1313 alt_dir = None
1314 else: 1314 else:
1315 alt_dir = None 1315 alt_dir = None
@@ -3584,7 +3584,7 @@ class Project:
3584 try: 3584 try:
3585 with open(path) as fd: 3585 with open(path) as fd:
3586 line = fd.readline() 3586 line = fd.readline()
3587 except IOError as e: 3587 except OSError as e:
3588 raise NoManifestException(path, str(e)) 3588 raise NoManifestException(path, str(e))
3589 try: 3589 try:
3590 line = line.decode() 3590 line = line.decode()