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>
diff --git a/git_config.py b/git_config.py
index 1bde479..6aa8d85 100644
--- a/git_config.py
+++ b/git_config.py
@@ -370,7 +370,7 @@
with Trace(": parsing %s", self.file):
with open(self._json) as fd:
return json.load(fd)
- except (IOError, ValueError):
+ except (OSError, ValueError):
platform_utils.remove(self._json, missing_ok=True)
return None
@@ -378,7 +378,7 @@
try:
with open(self._json, "w") as fd:
json.dump(cache, fd, indent=2)
- except (IOError, TypeError):
+ except (OSError, TypeError):
platform_utils.remove(self._json, missing_ok=True)
def _ReadGit(self):