Skip to content

Commit e5410b4

Browse files
cool-RRByron
authored andcommitted
Fix exception causes in loose.py
1 parent a5d3d7e commit e5410b4

File tree

1 file changed

+3
-3
lines changed

1 file changed

+3
-3
lines changed

gitdb/db/loose.py

+3-3
Original file line numberDiff line numberDiff line change
@@ -138,12 +138,12 @@ def _map_loose_object(self, sha):
138138
# try again without noatime
139139
try:
140140
return file_contents_ro_filepath(db_path)
141-
except OSError:
142-
raise BadObject(sha)
141+
except OSError as new_e:
142+
raise BadObject(sha) from new_e
143143
# didn't work because of our flag, don't try it again
144144
self._fd_open_flags = 0
145145
else:
146-
raise BadObject(sha)
146+
raise BadObject(sha) from e
147147
# END handle error
148148
# END exception handling
149149

0 commit comments

Comments
 (0)