mirror of
https://github.com/kovidgoyal/calibre.git
synced 2025-06-23 15:30:45 -04:00
Fix calibre 5.4 not running via Launch Services on macOS
This commit is contained in:
parent
ab93b6cde3
commit
abcdb53b0e
@ -48,12 +48,14 @@ def main():
|
||||
|
||||
set_helper()
|
||||
set_quit()
|
||||
mod = __import__(sys.calibre_module, fromlist=[1])
|
||||
func = getattr(mod, sys.calibre_function)
|
||||
if sys.gui_app and not (
|
||||
sys.stdout.isatty() or sys.stderr.isatty() or sys.stdin.isatty()
|
||||
):
|
||||
# this has to be done after calibre is imported and therefore
|
||||
# calibre_extensions is available.
|
||||
nuke_stdout()
|
||||
mod = __import__(sys.calibre_module, fromlist=[1])
|
||||
func = getattr(mod, sys.calibre_function)
|
||||
return func()
|
||||
|
||||
|
||||
|
Loading…
x
Reference in New Issue
Block a user