From 5d1d3af7f5ea479a9b2be3b047caea9a40c8b9ab Mon Sep 17 00:00:00 2001 From: Hasan Ramezani Date: Fri, 25 Oct 2019 11:09:20 +0200 Subject: [PATCH 1/2] Add import-outside-toplevel to pylintrc disable list. --- .pylintrc | 1 + 1 file changed, 1 insertion(+) diff --git a/.pylintrc b/.pylintrc index 89b82ab1..383d1159 100644 --- a/.pylintrc +++ b/.pylintrc @@ -21,6 +21,7 @@ disable= eval-used, fixme, import-error, + import-outside-toplevel, import-self, inconsistent-return-statements, invalid-name, From e7890d8d1b195ba3eb90ea3ccf3832bfd788e2d3 Mon Sep 17 00:00:00 2001 From: Hasan Ramezani Date: Fri, 25 Oct 2019 11:09:53 +0200 Subject: [PATCH 2/2] Fix lint errors (#2123) --- gunicorn/http/message.py | 2 +- gunicorn/reloader.py | 1 + gunicorn/util.py | 2 +- gunicorn/workers/gthread.py | 1 + 4 files changed, 4 insertions(+), 2 deletions(-) diff --git a/gunicorn/http/message.py b/gunicorn/http/message.py index 3c080207..4040c7ae 100644 --- a/gunicorn/http/message.py +++ b/gunicorn/http/message.py @@ -242,7 +242,7 @@ class Request(Message): if idx > limit > 0: raise LimitRequestLine(idx, limit) break - elif len(data) - 2 > limit > 0: + if len(data) - 2 > limit > 0: raise LimitRequestLine(len(data), limit) self.get_data(unreader, buf) data = buf.getvalue() diff --git a/gunicorn/reloader.py b/gunicorn/reloader.py index 500b22ed..acfc2f8f 100644 --- a/gunicorn/reloader.py +++ b/gunicorn/reloader.py @@ -2,6 +2,7 @@ # # This file is part of gunicorn released under the MIT license. # See the NOTICE for more information. +# pylint: disable=no-else-continue import os import os.path diff --git a/gunicorn/util.py b/gunicorn/util.py index b857d2d0..fbdd5cfc 100644 --- a/gunicorn/util.py +++ b/gunicorn/util.py @@ -323,7 +323,7 @@ def write_error(sock, status_int, reason, mesg): def import_app(module): parts = module.split(":", 1) if len(parts) == 1: - module, obj = module, "application" + obj = "application" else: module, obj = parts[0], parts[1] diff --git a/gunicorn/workers/gthread.py b/gunicorn/workers/gthread.py index 40960f00..5828ee93 100644 --- a/gunicorn/workers/gthread.py +++ b/gunicorn/workers/gthread.py @@ -9,6 +9,7 @@ # Keepalive connections are put back in the loop waiting for an event. # If no event happen after the keep alive timeout, the connection is # closed. +# pylint: disable=no-else-break import concurrent.futures as futures import errno