From 411635f78229cdec26167652d44434bf8aa309ab Mon Sep 17 00:00:00 2001 From: Ram Rachum Date: Sat, 13 Jun 2020 23:29:59 +0300 Subject: Fix exception causes all over the codebase --- git/objects/tree.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'git/objects/tree.py') diff --git a/git/objects/tree.py b/git/objects/tree.py index 469e5395..68e98329 100644 --- a/git/objects/tree.py +++ b/git/objects/tree.py @@ -203,8 +203,8 @@ class Tree(IndexObject, diff.Diffable, util.Traversable, util.Serializable): path = join_path(self.path, name) try: yield self._map_id_to_type[mode >> 12](self.repo, binsha, mode, path) - except KeyError: - raise TypeError("Unknown mode %o found in tree data for path '%s'" % (mode, path)) + except KeyError as e: + raise TypeError("Unknown mode %o found in tree data for path '%s'" % (mode, path)) from e # END for each item def join(self, file): -- cgit v1.2.1