Skip to content

Commit de924fd

Browse files
author
abdul
committed
Handling error when cwd does not exist
1 parent 991b3da commit de924fd

File tree

1 file changed

+9
-1
lines changed

1 file changed

+9
-1
lines changed

mongoctl/mongoctl.py

Lines changed: 9 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3310,7 +3310,15 @@ def resolve_path(path):
33103310
# expand vars
33113311
path = os.path.expandvars(custom_expanduser(path))
33123312
# Turn relative paths to absolute
3313-
path = os.path.abspath(path)
3313+
try:
3314+
path = os.path.abspath(path)
3315+
except OSError, e:
3316+
# handle the case where cwd does not exist
3317+
if "No such file or directory" in e.message:
3318+
pass
3319+
else:
3320+
raise
3321+
33143322
return path
33153323

33163324
###############################################################################

0 commit comments

Comments
 (0)