From b41b9818c29c9e9676888afac2735eb56d99a8ad Mon Sep 17 00:00:00 2001
From: TANIGUCHI Takaki <takaki@debian.org>
Date: Sun, 12 Sep 2021 13:20:35 +0900
Subject: [PATCH] New upstream version 4.0.7

---
 AUTHORS                     | 3 +++
 PKG-INFO                    | 2 +-
 gitdb.egg-info/PKG-INFO     | 2 +-
 gitdb.egg-info/requires.txt | 2 +-
 gitdb/__init__.py           | 6 +++---
 gitdb/db/loose.py           | 6 +++---
 gitdb/db/mem.py             | 4 ++--
 gitdb/util.py               | 4 ++--
 setup.py                    | 4 ++--
 9 files changed, 18 insertions(+), 15 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/PKG-INFO b/PKG-INFO
index f3fd89d..b37e48a 100644
--- a/PKG-INFO
+++ b/PKG-INFO
@@ -1,6 +1,6 @@
 Metadata-Version: 1.2
 Name: gitdb
-Version: 4.0.5
+Version: 4.0.7
 Summary: Git Object Database
 Home-page: https://github.com/gitpython-developers/gitdb
 Author: Sebastian Thiel
diff --git a/gitdb.egg-info/PKG-INFO b/gitdb.egg-info/PKG-INFO
index f3fd89d..b37e48a 100644
--- a/gitdb.egg-info/PKG-INFO
+++ b/gitdb.egg-info/PKG-INFO
@@ -1,6 +1,6 @@
 Metadata-Version: 1.2
 Name: gitdb
-Version: 4.0.5
+Version: 4.0.7
 Summary: Git Object Database
 Home-page: https://github.com/gitpython-developers/gitdb
 Author: Sebastian Thiel
diff --git a/gitdb.egg-info/requires.txt b/gitdb.egg-info/requires.txt
index 157fea4..014b5b5 100644
--- a/gitdb.egg-info/requires.txt
+++ b/gitdb.egg-info/requires.txt
@@ -1 +1 @@
-smmap<4,>=3.0.1
+smmap<5,>=3.0.1
diff --git a/gitdb/__init__.py b/gitdb/__init__.py
index 813fe5a..bef9696 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
 
@@ -30,7 +30,7 @@ _init_externals()
 __author__ = "Sebastian Thiel"
 __contact__ = "byronimo@gmail.com"
 __homepage__ = "https://github.com/gitpython-developers/gitdb"
-version_info = (4, 0, 5)
+version_info = (4, 0, 7)
 __version__ = '.'.join(str(i) for i in version_info)
 
 
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
diff --git a/setup.py b/setup.py
index facdf3d..59817d8 100755
--- a/setup.py
+++ b/setup.py
@@ -7,7 +7,7 @@ from setuptools import setup
 __author__ = "Sebastian Thiel"
 __contact__ = "byronimo@gmail.com"
 __homepage__ = "https://github.com/gitpython-developers/gitdb"
-version_info = (4, 0, 5)
+version_info = (4, 0, 7)
 __version__ = '.'.join(str(i) for i in version_info)
 
 setup(
@@ -20,7 +20,7 @@ setup(
     packages=('gitdb', 'gitdb.db', 'gitdb.utils', 'gitdb.test'),
     license="BSD License",
     zip_safe=False,
-    install_requires=['smmap>=3.0.1,<4'],
+    install_requires=['smmap>=3.0.1,<5'],
     long_description="""GitDB is a pure-Python git object database""",
     python_requires='>=3.4',
     # See https://pypi.python.org/pypi?%3Aaction=list_classifiers
-- 
GitLab