From 963aef19e03854c36bfb9f1f979e221dfab94e0a Mon Sep 17 00:00:00 2001 From: pcdinh Date: Sun, 23 Oct 2016 19:36:08 +0700 Subject: [PATCH 1/2] w is unused variable to it is safe to suppress Pylint warning using _ (underscore) --- sanic/sanic.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/sanic/sanic.py b/sanic/sanic.py index f8189d77..d73c7b1e 100644 --- a/sanic/sanic.py +++ b/sanic/sanic.py @@ -296,7 +296,7 @@ class Sanic: signal(SIGTERM, lambda s, f: stop_event.set()) processes = [] - for w in range(workers): + for _ in range(workers): process = Process(target=serve, kwargs=server_settings) process.start() processes.append(process) From 5361c6f243144207096c66279a444eac55877b57 Mon Sep 17 00:00:00 2001 From: pcdinh Date: Sun, 23 Oct 2016 19:38:28 +0700 Subject: [PATCH 2/2] e is an unused variable. Safe to remove --- sanic/server.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/sanic/server.py b/sanic/server.py index baacc10b..e4bff6fc 100644 --- a/sanic/server.py +++ b/sanic/server.py @@ -216,7 +216,7 @@ def serve(host, port, request_handler, before_start=None, after_start=None, try: http_server = loop.run_until_complete(server_coroutine) - except Exception as e: + except Exception: log.exception("Unable to start server") return