From 50139322ca4ffb21fa63fd2aa2ceafe7b644ac4f Mon Sep 17 00:00:00 2001 From: ii0606226 <63141266+ii0606226@users.noreply.github.com> Date: Mon, 18 Oct 2021 10:53:33 +0300 Subject: [PATCH] Make `import Server` conditional Move `import Server` into `if args.server:` code block so it doesn't get imported when it's not used (i.e. on `python nut.py --decompress `) and doesn't throw an exception on pycurl-less systems (i.e. Windows as per `requirements.txt`, line 20). Minimal testing done: before change `--decompress` throws an exception; after change `--decompress` works, `-S` throws an exception. --- nut.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/nut.py b/nut.py index 5ab49849e..b4c993c93 100755 --- a/nut.py +++ b/nut.py @@ -30,7 +30,6 @@ from nut import Status import time import colorama -import Server import pprint import random import shutil @@ -989,6 +988,7 @@ def download(id): Hook.call("args.post", args) if args.server: + import Server nut.initTitles() nut.initFiles() Server.run()