From 0ebc0cc78feb8759f813f84efe7804ef5a2e7501 Mon Sep 17 00:00:00 2001 From: Kovid Goyal Date: Tue, 29 Dec 2009 08:21:11 -0700 Subject: [PATCH] Workaround for bug in OS X Leopard that causes calibre to fail to launch after the first launch --- src/calibre/utils/ipc/worker.py | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/src/calibre/utils/ipc/worker.py b/src/calibre/utils/ipc/worker.py index a53d1818ba..9128673715 100644 --- a/src/calibre/utils/ipc/worker.py +++ b/src/calibre/utils/ipc/worker.py @@ -73,6 +73,12 @@ def get_func(name): return func, notification def main(): + from calibre.constants import isosx + if isosx and 'CALIBRE_WORKER_ADDRESS' not in os.environ: + # On some OS X computers launchd apparently tries to + # launch the last run process from the bundle + from calibre.gui2.main import main as gui_main + return gui_main([]) address = cPickle.loads(unhexlify(os.environ['CALIBRE_WORKER_ADDRESS'])) key = unhexlify(os.environ['CALIBRE_WORKER_KEY']) resultf = unhexlify(os.environ['CALIBRE_WORKER_RESULT'])