Commit 42b4eea0 authored by Jason Madden's avatar Jason Madden

Fix lint with pylint and astroid 2.2

parent 08d12491
......@@ -163,7 +163,7 @@ del sys
# outdated on each major release.
def __dependencies_for_freezing(): # pragma: no cover
# pylint:disable=unused-variable
# pylint:disable=unused-import
from gevent import core
from gevent import resolver_thread
from gevent import resolver_ares
......
......@@ -21,9 +21,7 @@ class ValuedWeakRef(ref):
"""
A weak ref with an associated value.
"""
# This seems entirely spurious; even on Python 2.7
# weakref.ref descends from object
# pylint: disable=slots-on-old-class
__slots__ = ('value',)
......
......@@ -99,7 +99,7 @@ class SSLContext(orig_SSLContext):
super(orig_SSLContext, orig_SSLContext).maximum_version.__set__(self, value)
class _contextawaresock(socket._gevent_sock_class): # Python 2: pylint:disable=slots-on-old-class
class _contextawaresock(socket._gevent_sock_class):
# We have to pass the raw stdlib socket to SSLContext.wrap_socket.
# That method in turn can pass that object on to things like SNI callbacks.
# It wouldn't have access to any of the attributes on the SSLSocket, like
......
......@@ -291,7 +291,6 @@ class BaseServer(object):
It is not supposed to be called by the user, it is called by :meth:`start` before starting
the accept loop."""
pass
@property
def started(self):
......
......@@ -218,7 +218,6 @@ class loop(AbstractLoop):
approx_timer_resolution = 0.00001
error_handler = None
_CHECK_POINTER = 'struct ev_check *'
......@@ -229,8 +228,7 @@ class loop(AbstractLoop):
def __init__(self, flags=None, default=None):
AbstractLoop.__init__(self, ffi, libev, _watchers, flags, default)
self._default = True if libev.ev_is_default_loop(self._ptr) else False
self._default = bool(libev.ev_is_default_loop(self._ptr))
def _init_loop(self, flags, default):
c_flags = _flags_to_int(flags)
......
......@@ -100,7 +100,7 @@ class watcher(_base.watcher):
self._flags |= 2 # now we've told libev
def _get_ref(self):
return False if self._flags & 4 else True
return not self._flags & 4
def _set_ref(self, value):
if value:
......@@ -144,7 +144,7 @@ class watcher(_base.watcher):
@property
def pending(self):
return True if self._watcher and libev.ev_is_pending(self._watcher) else False
return bool(self._watcher and libev.ev_is_pending(self._watcher))
class io(_base.IoMixin, watcher):
......@@ -218,7 +218,7 @@ class async_(_base.AsyncMixin, watcher):
@property
def pending(self):
return True if libev.ev_async_pending(self._watcher) else False
return bool(libev.ev_async_pending(self._watcher))
# Provide BWC for those that have async
locals()['async'] = async_
......
......@@ -174,7 +174,7 @@ class watcher(_base.watcher):
# Convert 1/0 to True/False
if self._watcher is None:
return None
return True if libuv.uv_has_ref(self._watcher) else False
return bool(libuv.uv_has_ref(self._watcher))
def _set_ref(self, value):
if value:
......
......@@ -158,7 +158,6 @@ class DummySemaphore(object):
.. versionchanged:: 1.1rc3
Accept and ignore a *value* argument for compatibility with Semaphore.
"""
pass
def __str__(self):
return '<%s>' % self.__class__.__name__
......@@ -169,7 +168,6 @@ class DummySemaphore(object):
def release(self):
"""Releasing a dummy semaphore does nothing."""
pass
def rawlink(self, callback):
# XXX should still work and notify?
......@@ -180,7 +178,6 @@ class DummySemaphore(object):
def wait(self, timeout=None):
"""Waiting for a DummySemaphore returns immediately."""
pass
def acquire(self, blocking=True, timeout=None):
"""
......
......@@ -488,7 +488,6 @@ class Group(GroupMappingMixin):
In this implementation, because there are no limits on the number
of tracked greenlets, this will always return immediately.
"""
pass
# MappingMixin methods
......
......@@ -1188,7 +1188,6 @@ class LoggingLogAdapter(object):
def flush(self):
"No-op; required to be a file-like object"
pass
def writelines(self, lines):
for line in lines:
......
......@@ -92,7 +92,7 @@ def TESTRUNNER(tests=None):
if tests and not sys.platform.startswith("win"):
atexit.register(os.system, 'rm -f */@test*')
basic_args = [sys.executable, '-u', '-W', 'ignore', '-m' 'gevent.testing.monkey_test']
basic_args = [sys.executable, '-u', '-W', 'ignore', '-m', 'gevent.testing.monkey_test']
for filename in tests:
if filename in version_tests:
util.log("Overriding %s from %s with file from %s", filename, test_dir, version_test_dir)
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment