summaryrefslogtreecommitdiff
path: root/doc
diff options
context:
space:
mode:
authorMartin <MartinBasti@users.noreply.github.com>2021-11-03 22:49:04 +0100
committerGitHub <noreply@github.com>2021-11-03 22:49:04 +0100
commitde307ccf20c69ef1cfba05c000de19ec2407b5cd (patch)
tree84cc363659730c3819ca9710ecf4bce6f67954a9 /doc
parentbe9e34722f521608a24a0d00e6991913bbad835a (diff)
downloadpylint-git-de307ccf20c69ef1cfba05c000de19ec2407b5cd.tar.gz
Inspection for `with threading.Lock():` (#5245)
Using `with threading.Lock():` directly has no effect. Correct usage is: ``` lock = threading.Lock() with lock: ... ``` This applies for: * threading.Lock * threading.RLock * threading.Condition * threading.Semaphore * threading.BoundedSemaphore Signed-off-by: Martin Basti <mbasti@redhat.com>
Diffstat (limited to 'doc')
-rw-r--r--doc/whatsnew/2.12.rst4
1 files changed, 4 insertions, 0 deletions
diff --git a/doc/whatsnew/2.12.rst b/doc/whatsnew/2.12.rst
index 7fbb4ab71..b2e57a8a7 100644
--- a/doc/whatsnew/2.12.rst
+++ b/doc/whatsnew/2.12.rst
@@ -48,6 +48,10 @@ New checkers
Closes #3370
+* Added new checker ``useless-with-lock`` to find incorrect usage of with statement and threading module locks.
+ Emitted when ``with threading.Lock():`` is used instead of ``with lock_instance:``.
+
+ Closes #5208
Removed checkers
================