summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorSebastian Thiel <sebastian.thiel@icloud.com>2021-01-21 13:15:15 +0800
committerSebastian Thiel <sebastian.thiel@icloud.com>2021-01-21 13:15:15 +0800
commite45fd0792ee9a987a4df26e3139f5c3b107f0092 (patch)
tree6b3ae4486e992563ac2043e68aef7c75028c6e8a
parent163f2649e5a5f7b8ba03fc1714bf4693b1a015d0 (diff)
parentc96c755fa30277fbaadf79603a0b4fa1054ce2cb (diff)
downloadgitdb-e45fd0792ee9a987a4df26e3139f5c3b107f0092.tar.gz
Merge remote-tracking branch 'origin'
-rw-r--r--AUTHORS3
-rw-r--r--gitdb/__init__.py4
-rw-r--r--gitdb/db/loose.py6
-rw-r--r--gitdb/db/mem.py4
-rw-r--r--gitdb/util.py4
5 files changed, 12 insertions, 9 deletions
diff --git a/AUTHORS b/AUTHORS
index 490baad..6c7e9b9 100644
--- a/AUTHORS
+++ b/AUTHORS
@@ -1 +1,4 @@
Creator: Sebastian Thiel
+
+Contributors:
+ - Ram Rachum (@cool-RR)
diff --git a/gitdb/__init__.py b/gitdb/__init__.py
index 813fe5a..2e127ca 100644
--- a/gitdb/__init__.py
+++ b/gitdb/__init__.py
@@ -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
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 @@ class LooseObjectDB(FileDBBase, ObjectDBR, ObjectDBW):
# 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
diff --git a/gitdb/db/mem.py b/gitdb/db/mem.py
index 8711334..5b242e4 100644
--- a/gitdb/db/mem.py
+++ b/gitdb/db/mem.py
@@ -74,8 +74,8 @@ class MemoryDB(ObjectDBR, ObjectDBW):
# 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):
diff --git a/gitdb/util.py b/gitdb/util.py
index d680f97..c4cafec 100644
--- a/gitdb/util.py
+++ b/gitdb/util.py
@@ -326,8 +326,8 @@ class LockedFD(object):
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