1
0
Fork 0
mirror of https://github.com/borgbase/vorta synced 2025-02-21 22:06:57 +00:00

do not fork into background with any fat binary (#124)

this avoids that someone e.g. porting to freebsd (which is also
supported by PyInstaller) will stumble over the platform check.
This commit is contained in:
TW 2019-01-15 16:21:52 +01:00 committed by Manuel Riel
parent 42191725b5
commit badb966f4e

View file

@ -14,9 +14,10 @@ def main():
args = parse_args()
frozen_binary = getattr(sys, 'frozen', False)
need_foreground = frozen_binary and sys.platform in ('darwin', 'linux')
want_foreground = getattr(args, 'foreground', False)
if not (want_foreground or need_foreground):
# We assume that a frozen binary is a fat single-file binary made with
# PyInstaller. These are not compatible with forking into background here:
if not (want_foreground or frozen_binary):
print('Forking to background (see system tray).')
if os.fork():
sys.exit()