diff --git a/git_refs.py b/git_refs.py index ac8ed0c1..0e3cc820 100644 --- a/git_refs.py +++ b/git_refs.py @@ -139,13 +139,15 @@ class GitRefs(object): def _ReadLoose1(self, path, name): try: fd = open(path, 'rb') - mtime = os.path.getmtime(path) - except OSError: - return - except IOError: + except: return + try: - id = fd.readline() + try: + mtime = os.path.getmtime(path) + id = fd.readline() + except: + return finally: fd.close()