CurrentDir context now ignores the case when the original working dir no longer exists

This commit is contained in:
Kovid Goyal
2011-04-25 15:06:06 -06:00
parent 1ec25e442b
commit b76159f31c
+5 -1
View File
@@ -388,7 +388,11 @@ class CurrentDir(object):
return self.cwd
def __exit__(self, *args):
os.chdir(self.cwd)
try:
os.chdir(self.cwd)
except:
# The previous CWD no longer exists
pass
class StreamReadWrapper(object):