Skip to content

Commit

Permalink
[lint] Fix pylint errors in py38
Browse files Browse the repository at this point in the history
  • Loading branch information
Bastien Vallet committed Oct 24, 2019
1 parent da35c62 commit ada1fb4
Show file tree
Hide file tree
Showing 6 changed files with 21 additions and 19 deletions.
2 changes: 2 additions & 0 deletions gunicorn/app/wsgiapp.py
Expand Up @@ -3,6 +3,8 @@
# This file is part of gunicorn released under the MIT license.
# See the NOTICE for more information.

# pylint: disable=import-outside-toplevel

import os

from gunicorn.errors import ConfigError
Expand Down
2 changes: 1 addition & 1 deletion gunicorn/http/message.py
Expand Up @@ -242,7 +242,7 @@ def read_line(self, unreader, buf, limit=0):
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()
Expand Down
2 changes: 1 addition & 1 deletion gunicorn/reloader.py
Expand Up @@ -50,7 +50,7 @@ def run(self):
if old_time is None:
mtimes[filename] = mtime
continue
elif mtime > old_time:
if mtime > old_time:
if self._callback:
self._callback(filename)
time.sleep(self._interval)
Expand Down
2 changes: 1 addition & 1 deletion gunicorn/util.py
Expand Up @@ -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]

Expand Down
30 changes: 15 additions & 15 deletions gunicorn/workers/gthread.py
Expand Up @@ -156,21 +156,21 @@ def murder_keepalived(self):
with self._lock:
self._keep.appendleft(conn)
break
else:
self.nr_conns -= 1
# remove the socket from the poller
with self._lock:
try:
self.poller.unregister(conn.sock)
except EnvironmentError as e:
if e.errno != errno.EBADF:
raise
except KeyError:
# already removed by the system, continue
pass

# close the socket
conn.close()

self.nr_conns -= 1
# remove the socket from the poller
with self._lock:
try:
self.poller.unregister(conn.sock)
except EnvironmentError as e:
if e.errno != errno.EBADF:
raise
except KeyError:
# already removed by the system, continue
pass

# close the socket
conn.close()

def is_parent_alive(self):
# If our parent changed then we shut down.
Expand Down
2 changes: 1 addition & 1 deletion tests/test_config.py
Expand Up @@ -4,6 +4,7 @@
# See the NOTICE for more information.

import os
from os.path import isdir as testfunc
import sys

import pytest
Expand Down Expand Up @@ -169,7 +170,6 @@ def test_reload_engine_validation():


def test_callable_validation_for_string():
from os.path import isdir as testfunc
assert config.validate_callable(-1)("os.path.isdir") == testfunc

# invalid values tests
Expand Down

0 comments on commit ada1fb4

Please sign in to comment.