diff options
author | Ram Rachum <ram@rachum.com> | 2020-06-13 23:29:59 +0300 |
---|---|---|
committer | Sebastian Thiel <sebastian.thiel@icloud.com> | 2020-06-14 08:30:09 +0800 |
commit | 411635f78229cdec26167652d44434bf8aa309ab (patch) | |
tree | 1e301ce6bdd458d4db20c993695bb763d1b9d158 /git/__init__.py | |
parent | 99ba753b837faab0509728ee455507f1a682b471 (diff) | |
download | gitpython-411635f78229cdec26167652d44434bf8aa309ab.tar.gz |
Fix exception causes all over the codebase
Diffstat (limited to 'git/__init__.py')
-rw-r--r-- | git/__init__.py | 8 |
1 files changed, 4 insertions, 4 deletions
diff --git a/git/__init__.py b/git/__init__.py index 8f32d07b..50730742 100644 --- a/git/__init__.py +++ b/git/__init__.py @@ -23,8 +23,8 @@ def _init_externals(): try: import gitdb - except ImportError: - raise ImportError("'gitdb' could not be found in your PYTHONPATH") + except ImportError as e: + raise ImportError("'gitdb' could not be found in your PYTHONPATH") from e # END verify import #} END initialization @@ -54,7 +54,7 @@ try: rmtree, ) except GitError as exc: - raise ImportError('%s: %s' % (exc.__class__.__name__, exc)) + raise ImportError('%s: %s' % (exc.__class__.__name__, exc)) from exc #} END imports @@ -82,5 +82,5 @@ def refresh(path=None): try: refresh() except Exception as exc: - raise ImportError('Failed to initialize: {0}'.format(exc)) + raise ImportError('Failed to initialize: {0}'.format(exc)) from exc ################# |