If calibre is atrted from a directory that does not exist, automatically use the home directory as the working directory, instead of crashing

This commit is contained in:
Kovid Goyal 2012-01-15 10:16:24 +05:30
parent d30bbdd8aa
commit 466f73159e

View File

@ -10,7 +10,10 @@ from math import floor
from functools import partial from functools import partial
warnings.simplefilter('ignore', DeprecationWarning) warnings.simplefilter('ignore', DeprecationWarning)
try:
os.getcwdu()
except:
os.chdir(os.path.expanduser('~'))
from calibre.constants import (iswindows, isosx, islinux, isfrozen, from calibre.constants import (iswindows, isosx, islinux, isfrozen,
isbsd, preferred_encoding, __appname__, __version__, __author__, isbsd, preferred_encoding, __appname__, __version__, __author__,