Skip to content

Commit e45fd07

Browse files
committed
Merge remote-tracking branch 'origin'
2 parents 163f264 + c96c755 commit e45fd07

File tree

5 files changed

+12
-9
lines changed

5 files changed

+12
-9
lines changed

Diff for: AUTHORS

+3
Original file line numberDiff line numberDiff line change
@@ -1 +1,4 @@
11
Creator: Sebastian Thiel
2+
3+
Contributors:
4+
- Ram Rachum (@cool-RR)

Diff for: gitdb/__init__.py

+2-2
Original file line numberDiff line numberDiff line change
@@ -18,8 +18,8 @@ def _init_externals():
1818

1919
try:
2020
__import__(module)
21-
except ImportError:
22-
raise ImportError("'%s' could not be imported, assure it is located in your PYTHONPATH" % module)
21+
except ImportError as e:
22+
raise ImportError("'%s' could not be imported, assure it is located in your PYTHONPATH" % module) from e
2323
# END verify import
2424
# END handel imports
2525

Diff for: 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

Diff for: gitdb/db/mem.py

+2-2
Original file line numberDiff line numberDiff line change
@@ -74,8 +74,8 @@ def stream(self, sha):
7474
# rewind stream for the next one to read
7575
ostream.stream.seek(0)
7676
return ostream
77-
except KeyError:
78-
raise BadObject(sha)
77+
except KeyError as e:
78+
raise BadObject(sha) from e
7979
# END exception handling
8080

8181
def size(self):

Diff for: gitdb/util.py

+2-2
Original file line numberDiff line numberDiff line change
@@ -326,8 +326,8 @@ def open(self, write=False, stream=False):
326326
else:
327327
self._fd = fd
328328
# END handle file descriptor
329-
except OSError:
330-
raise IOError("Lock at %r could not be obtained" % self._lockfilepath())
329+
except OSError as e:
330+
raise IOError("Lock at %r could not be obtained" % self._lockfilepath()) from e
331331
# END handle lock retrieval
332332

333333
# open actual file if required

0 commit comments

Comments
 (0)