mirror of
https://salsa.debian.org/freeipa-team/freeipa.git
synced 2025-02-25 18:55:28 -06:00
pylint: fix not-context-manager false positives
threading.Lock() in ipa-replica-conncheck is an alias to thread.allocate_lock() which creates a LockType object. This object is an actual context manager but the alias seems to confuse pylint a bit. https://pagure.io/freeipa/issue/6874 Reviewed-By: Alexander Bokovoy <abokovoy@redhat.com>
This commit is contained in:
parent
75e9f3ac6f
commit
a765746e95
@ -318,7 +318,7 @@ class PortResponder(threading.Thread):
|
||||
logger.debug('%d %s: Stopped listening', port, proto)
|
||||
|
||||
def _is_closing(self):
|
||||
with self._close_lock:
|
||||
with self._close_lock: # pylint: disable=not-context-manager
|
||||
return self._close
|
||||
|
||||
def _bind_to_port(self, port, socket_type):
|
||||
@ -369,7 +369,7 @@ class PortResponder(threading.Thread):
|
||||
def stop(self):
|
||||
logger.debug('Stopping listening thread.')
|
||||
|
||||
with self._close_lock:
|
||||
with self._close_lock: # pylint: disable=not-context-manager
|
||||
self._close = True
|
||||
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user