Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions gitdb/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -18,8 +18,8 @@ def _init_externals():

try:
__import__(module)
except ImportError:
raise ImportError("'%s' could not be imported, assure it is located in your PYTHONPATH" % module)
except ImportError as e:
raise ImportError("'%s' could not be imported, assure it is located in your PYTHONPATH" % module) from e
# END verify import
# END handel imports

Expand Down
4 changes: 2 additions & 2 deletions gitdb/db/mem.py
Original file line number Diff line number Diff line change
Expand Up @@ -74,8 +74,8 @@ def stream(self, sha):
# rewind stream for the next one to read
ostream.stream.seek(0)
return ostream
except KeyError:
raise BadObject(sha)
except KeyError as e:
raise BadObject(sha) from e
# END exception handling

def size(self):
Expand Down
4 changes: 2 additions & 2 deletions gitdb/util.py
Original file line number Diff line number Diff line change
Expand Up @@ -326,8 +326,8 @@ def open(self, write=False, stream=False):
else:
self._fd = fd
# END handle file descriptor
except OSError:
raise IOError("Lock at %r could not be obtained" % self._lockfilepath())
except OSError as e:
raise IOError("Lock at %r could not be obtained" % self._lockfilepath()) from e
# END handle lock retrieval

# open actual file if required
Expand Down