mirror of
https://github.com/kovidgoyal/calibre.git
synced 2025-07-09 03:04:10 -04:00
CurrentDir context now ignores the case when the original working dir no longer exists
This commit is contained in:
parent
1ec25e442b
commit
b76159f31c
@ -388,7 +388,11 @@ class CurrentDir(object):
|
|||||||
return self.cwd
|
return self.cwd
|
||||||
|
|
||||||
def __exit__(self, *args):
|
def __exit__(self, *args):
|
||||||
os.chdir(self.cwd)
|
try:
|
||||||
|
os.chdir(self.cwd)
|
||||||
|
except:
|
||||||
|
# The previous CWD no longer exists
|
||||||
|
pass
|
||||||
|
|
||||||
|
|
||||||
class StreamReadWrapper(object):
|
class StreamReadWrapper(object):
|
||||||
|
Loading…
x
Reference in New Issue
Block a user