From 871b313d95cc0e49a62beffddf344d5c744d4f22 Mon Sep 17 00:00:00 2001 From: Arthur Lu Date: Tue, 17 Aug 2021 14:17:40 -0700 Subject: [PATCH] fixed linux only import in windows exec Former-commit-id: 61ae377e97a63385ffaaaa13413b207f54524902 --- src/cli/superscript.py | 9 ++++----- 1 file changed, 4 insertions(+), 5 deletions(-) diff --git a/src/cli/superscript.py b/src/cli/superscript.py index 009c579..c16b7a7 100644 --- a/src/cli/superscript.py +++ b/src/cli/superscript.py @@ -376,7 +376,7 @@ async def main_lin(socket, path): sys.exit(loop_exit_code) -def main_win(): # windows main function +def main_win(): warnings.filterwarnings("ignore") sys.stderr = open("errorlog.txt", "w") @@ -582,10 +582,6 @@ def save_config(path, config_vector): except: return 1 -import daemon -from daemon import pidfile -from signal import SIGTERM - def start(pid_path, profile = False): f = open('errorlog.txt', 'w+') with daemon.DaemonContext( @@ -630,6 +626,9 @@ if __name__ == "__main__": main_win() else: + import daemon + from daemon import pidfile + from signal import SIGTERM pid_path = "tra-daemon.pid" if len(sys.argv) == 2: if 'start' == sys.argv[1]: