From df9171edd14727a2493a35fd9de0d50ca37a54a0 Mon Sep 17 00:00:00 2001 From: joo Date: Sun, 16 Apr 2017 03:58:35 +0100 Subject: [PATCH] Suppress erroneous Pylint not-context-manager errors. See: https://github.com/PyCQA/pylint/issues/782 --- minecraft/networking/connection.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/minecraft/networking/connection.py b/minecraft/networking/connection.py index c69028f..3bd219d 100644 --- a/minecraft/networking/connection.py +++ b/minecraft/networking/connection.py @@ -234,7 +234,7 @@ class Connection(object): """ # Hold the lock throughout, in case connect() is called from the # 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 # in status mode, as some servers, e.g. SpigotMC with the @@ -278,7 +278,7 @@ class Connection(object): def disconnect(self): """ Terminate the existing server connection, if there is one. """ 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 if self.socket is not None: