Suppress erroneous Pylint not-context-manager errors.

See: https://github.com/PyCQA/pylint/issues/782
This commit is contained in:
joo committed 2017-04-16 03:58:35 +01:00
1 parent 3981c46569
commit df9171edd1
1 file changed
+2 -2
+2 -2
View File
@@ -234,7 +234,7 @@ class Connection(object):
""" """
# Hold the lock throughout, in case connect() is called from the # Hold the lock throughout, in case connect() is called from the
# networking thread while another connection is in progress. # networking thread while another connection is in progress.
with self._write_lock: with self._write_lock: # pylint: disable=not-context-manager
# It is important that this is set correctly even when connecting # It is important that this is set correctly even when connecting
# in status mode, as some servers, e.g. SpigotMC with the # in status mode, as some servers, e.g. SpigotMC with the
@@ -278,7 +278,7 @@ class Connection(object):
def disconnect(self): def disconnect(self):
""" Terminate the existing server connection, if there is one. """ """ Terminate the existing server connection, if there is one. """
if self.networking_thread is not None: if self.networking_thread is not None:
with self._write_lock: with self._write_lock: # pylint: disable=not-context-manager
self.networking_thread.interrupt = True self.networking_thread.interrupt = True
if self.socket is not None: if self.socket is not None: