diff options
author | Sebastian Thiel <sebastian.thiel@icloud.com> | 2021-08-12 07:30:49 +0800 |
---|---|---|
committer | Sebastian Thiel <sebastian.thiel@icloud.com> | 2021-08-12 07:37:46 +0800 |
commit | 5b3669e24a8ce7f3f482de86fcf95620db643467 (patch) | |
tree | ea99047b90cfcd48fc11d5a8fe44bf4ed79e0419 /git/cmd.py | |
parent | ea1a03af3b4135ce297cb8ac9d9bd38c6cdfd0b2 (diff) | |
download | gitpython-5b3669e24a8ce7f3f482de86fcf95620db643467.tar.gz |
Don't fail on import if the working dir isn't valid (#1319)
Diffstat (limited to 'git/cmd.py')
-rw-r--r-- | git/cmd.py | 5 |
1 files changed, 4 insertions, 1 deletions
@@ -781,7 +781,10 @@ class Git(LazyMixin): log.info(' '.join(redacted_command)) # Allow the user to have the command executed in their working dir. - cwd = self._working_dir or os.getcwd() + try: + cwd = self._working_dir or os.getcwd() # type: Union[None, str] + except FileNotFoundError: + cwd = None # Start the process inline_env = env |