Skip to content

Commit

Permalink
Handling error when cwd does not exist
Browse files Browse the repository at this point in the history
  • Loading branch information
abdul committed Mar 28, 2013
1 parent 991b3da commit de924fd
Showing 1 changed file with 9 additions and 1 deletion.
10 changes: 9 additions & 1 deletion mongoctl/mongoctl.py
Original file line number Diff line number Diff line change
Expand Up @@ -3310,7 +3310,15 @@ def resolve_path(path):
# expand vars
path = os.path.expandvars(custom_expanduser(path))
# Turn relative paths to absolute
path = os.path.abspath(path)
try:
path = os.path.abspath(path)
except OSError, e:
# handle the case where cwd does not exist
if "No such file or directory" in e.message:
pass
else:
raise

return path

###############################################################################
Expand Down

0 comments on commit de924fd

Please sign in to comment.