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:
parent
42191725b5
commit
badb966f4e
1 changed files with 3 additions and 2 deletions
|
@ -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()
|
||||
|
|
Loading…
Reference in a new issue