Skip to content

Commit 5b3669e

Browse files
committed
Don't fail on import if the working dir isn't valid (#1319)
1 parent ea1a03a commit 5b3669e

File tree

1 file changed

+4
-1
lines changed

1 file changed

+4
-1
lines changed

Diff for: git/cmd.py

+4-1
Original file line numberDiff line numberDiff line change
@@ -781,7 +781,10 @@ def execute(self,
781781
log.info(' '.join(redacted_command))
782782

783783
# Allow the user to have the command executed in their working dir.
784-
cwd = self._working_dir or os.getcwd()
784+
try:
785+
cwd = self._working_dir or os.getcwd() # type: Union[None, str]
786+
except FileNotFoundError:
787+
cwd = None
785788

786789
# Start the process
787790
inline_env = env

0 commit comments

Comments
 (0)