From c98ed0db76079158a80464096a81398bdd3c41b8 Mon Sep 17 00:00:00 2001 From: Kovid Goyal Date: Sat, 5 Dec 2009 08:33:50 -0700 Subject: [PATCH] Finding calibre-parallel: If sys.executables_location is wrong (as might happen in distro packages) fallback to using PATH --- src/calibre/utils/ipc/launch.py | 11 ++++++++--- 1 file changed, 8 insertions(+), 3 deletions(-) diff --git a/src/calibre/utils/ipc/launch.py b/src/calibre/utils/ipc/launch.py index dbabfe86b2..0de81ed644 100644 --- a/src/calibre/utils/ipc/launch.py +++ b/src/calibre/utils/ipc/launch.py @@ -54,9 +54,14 @@ class Worker(object): 'console.app', 'Contents') return os.path.join(contents, 'MacOS', self.osx_interpreter) - return os.path.join(getattr(sys, 'frozen_path'), 'calibre-parallel') \ - if isfrozen else \ - os.path.join(sys.executables_location, 'calibre-parallel') + if isfrozen: + return os.path.join(getattr(sys, 'frozen_path'), 'calibre-parallel') + + c = os.path.join(sys.executables_location, 'calibre-parallel') + if os.access(c, os.X_OK): + return c + return 'calibre-parallel' + @property def gui_executable(self):