diff options
author | Jason R. Coombs <jaraco@jaraco.com> | 2023-10-20 23:32:40 +0545 |
---|---|---|
committer | LUCI <gerrit-scoped@luci-project-accounts.iam.gserviceaccount.com> | 2023-10-21 00:56:10 +0000 |
commit | ae824fb2fc2770c84cc34c1956e4c76c8c972860 (patch) | |
tree | 4f8ec44e29c7401b99b3aef1b28a2104a0a86221 /repo | |
parent | 034950b9eebacd6598ea518a0b254845bc806ab6 (diff) | |
download | git-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 'repo')
-rwxr-xr-x | repo | 4 |
1 files changed, 2 insertions, 2 deletions
@@ -627,7 +627,7 @@ def get_gitc_manifest_dir(): | |||
627 | match = re.match("gitc_dir=(?P<gitc_manifest_dir>.*)", line) | 627 | match = re.match("gitc_dir=(?P<gitc_manifest_dir>.*)", line) |
628 | if match: | 628 | if match: |
629 | _gitc_manifest_dir = match.group("gitc_manifest_dir") | 629 | _gitc_manifest_dir = match.group("gitc_manifest_dir") |
630 | except IOError: | 630 | except OSError: |
631 | pass | 631 | pass |
632 | return _gitc_manifest_dir | 632 | return _gitc_manifest_dir |
633 | 633 | ||
@@ -1277,7 +1277,7 @@ class Requirements: | |||
1277 | try: | 1277 | try: |
1278 | with open(path, "rb") as f: | 1278 | with open(path, "rb") as f: |
1279 | data = f.read() | 1279 | data = f.read() |
1280 | except EnvironmentError: | 1280 | except OSError: |
1281 | # NB: EnvironmentError is used for Python 2 & 3 compatibility. | 1281 | # NB: EnvironmentError is used for Python 2 & 3 compatibility. |
1282 | # If we couldn't open the file, assume it's an old source tree. | 1282 | # If we couldn't open the file, assume it's an old source tree. |
1283 | return None | 1283 | return None |