diff --git a/src/calibre/ptempfile.py b/src/calibre/ptempfile.py index fe69949f99..f4bcfa8675 100644 --- a/src/calibre/ptempfile.py +++ b/src/calibre/ptempfile.py @@ -46,7 +46,10 @@ class PersistentTemporaryFile(object): self.close() def __del__(self): - self.close() + try: + self.close() + except: + pass def PersistentTemporaryDirectory(suffix='', prefix='', dir=None): diff --git a/src/calibre/utils/osx_symlinks.py b/src/calibre/utils/osx_symlinks.py index 2cfdd72fa3..63863cb810 100644 --- a/src/calibre/utils/osx_symlinks.py +++ b/src/calibre/utils/osx_symlinks.py @@ -7,6 +7,7 @@ __copyright__ = '2009, Kovid Goyal ' __docformat__ = 'restructuredtext en' import sys, os, cPickle +from calibre.constants import isnewosx AUTHTOOL="""#!/usr/bin/python import os @@ -27,7 +28,7 @@ for s, l in zip(scripts, links): DEST_PATH = '/usr/bin' def create_symlinks(): - return create_symlinks_new() if getattr(sys, 'new_app_bundle', False) else create_symlinks_old() + return create_symlinks_new() if isnewosx else create_symlinks_old() def get_scripts(): return cPickle.load(open(P('scripts.pickle'), 'rb'))