Only catch and ignore EnvironmentErrors when installing env module

This commit is contained in:
Kovid Goyal 2015-08-28 07:58:40 +05:30
parent c4f232b967
commit e83fc1c982

View File

@ -144,12 +144,13 @@ class Develop(Command):
try: try:
if not os.path.exists(libdir): if not os.path.exists(libdir):
os.makedirs(libdir) os.makedirs(libdir)
except EnvironmentError:
self.warn('Cannot install calibre environment module to: '+libdir)
else:
path = os.path.join(libdir, 'init_calibre.py') path = os.path.join(libdir, 'init_calibre.py')
self.info('Installing calibre environment module: '+path) self.info('Installing calibre environment module: '+path)
with open(path, 'wb') as f: with open(path, 'wb') as f:
f.write(HEADER.format(**self.template_args())) f.write(HEADER.format(**self.template_args()))
except:
self.warn('Cannot install calibre environment module to: '+libdir)
def install_files(self): def install_files(self):
pass pass