From 7ccfd13d5210149b84e359c5e20f3f006120f120 Mon Sep 17 00:00:00 2001 From: Tom Gillespie Date: Thu, 9 Jan 2020 19:31:14 -0800 Subject: [PATCH] repo better error reporting if git is missing --- augpathlib/__init__.py | 14 +++++++++++--- 1 file changed, 11 insertions(+), 3 deletions(-) diff --git a/augpathlib/__init__.py b/augpathlib/__init__.py index 9a44386..95d0dc4 100644 --- a/augpathlib/__init__.py +++ b/augpathlib/__init__.py @@ -23,6 +23,7 @@ 'AugmentedPath', 'XattrPath', + 'RepoPath', 'XopenPath', 'LocalPath', @@ -38,8 +39,15 @@ try: from augpathlib.repo import RepoHelper, RepoPath - __all__ += 'RepoPath' -except ImportError: - pass +except ImportError as e: + class RepoHelper: + def __init__(self, *args, **kwargs): + raise ImportError(f'{self.__class__.__name__} could not be imported ' + 'due to a previous ImportError') from e + + + class RepoPath(RepoHelper): + pass + __version__ = '0.0.5'