mirror of
https://salsa.debian.org/freeipa-team/freeipa.git
synced 2025-02-25 18:55:28 -06:00
pylint: Fix deprecated-method for threading
As of Python3 `currentThread`, `thread.getName` are aliases for `threading.current_thread()` and `threading.Thread.name` respectively. In Python3.10: > bpo-43723: The following threading methods are now deprecated and should be replaced: currentThread => threading.current_thread() activeCount => threading.active_count() Condition.notifyAll => threading.Condition.notify_all() Event.isSet => threading.Event.is_set() Thread.setName => threading.Thread.name thread.getName => threading.Thread.name Thread.isDaemon => threading.Thread.daemon Thread.setDaemon => threading.Thread.daemon Fixes: https://pagure.io/freeipa/issue/9117 Signed-off-by: Stanislav Levin <slev@altlinux.org> Reviewed-By: Rob Crittenden <rcritten@redhat.com>
This commit is contained in:
committed by
Rob Crittenden
parent
adc7b7cc0b
commit
feab723c59
@@ -63,7 +63,7 @@ class Connectible(Backend):
|
||||
"{0} is already connected ({1} in {2})".format(
|
||||
self.name,
|
||||
self.id,
|
||||
threading.currentThread().getName()
|
||||
threading.current_thread().name,
|
||||
)
|
||||
)
|
||||
conn = self.create_connection(*args, **kw)
|
||||
@@ -80,7 +80,7 @@ class Connectible(Backend):
|
||||
"{0} is not connected ({1} in {2})".format(
|
||||
self.name,
|
||||
self.id,
|
||||
threading.currentThread().getName()
|
||||
threading.current_thread().name,
|
||||
)
|
||||
)
|
||||
self.destroy_connection()
|
||||
@@ -105,7 +105,7 @@ class Connectible(Backend):
|
||||
"{0} is not connected ({1} in {2})".format(
|
||||
self.name,
|
||||
self.id,
|
||||
threading.currentThread().getName()
|
||||
threading.current_thread().name,
|
||||
)
|
||||
)
|
||||
return getattr(context, self.id).conn
|
||||
|
||||
Reference in New Issue
Block a user