Dont fail to launch worker process if cwd no longer exists

This commit is contained in:
Kovid Goyal 2013-03-07 12:06:17 +05:30
parent c5335f476e
commit db67eb621b

View File

@ -167,8 +167,14 @@ class Worker(object):
'''
exe = self.gui_executable if self.gui else self.executable
env = self.env
env[b'ORIGWD'] = binascii.hexlify(cPickle.dumps(cwd or
os.path.abspath(os.getcwdu())))
try:
env[b'ORIGWD'] = binascii.hexlify(cPickle.dumps(
cwd or os.path.abspath(os.getcwdu())))
except EnvironmentError:
# cwd no longer exists
env[b'ORIGWD'] = binascii.hexlify(cPickle.dumps(
cwd or os.path.expanduser(u'~')))
_cwd = cwd
if priority is None:
priority = prefs['worker_process_priority']