diff --git a/gitdb/db/loose.py b/gitdb/db/loose.py index 7bf92da..a63a2ef 100644 --- a/gitdb/db/loose.py +++ b/gitdb/db/loose.py @@ -138,12 +138,12 @@ def _map_loose_object(self, sha): # try again without noatime try: return file_contents_ro_filepath(db_path) - except OSError: - raise BadObject(sha) + except OSError as new_e: + raise BadObject(sha) from new_e # didn't work because of our flag, don't try it again self._fd_open_flags = 0 else: - raise BadObject(sha) + raise BadObject(sha) from e # END handle error # END exception handling