Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Commit b99158c

Browse files
committed
Fix issue gitpython-developers#1 by using staticmethod to prevent unintended conversion of Lock to a
staticmethod.
1 parent 039c1d5 commit b99158c

File tree

1 file changed

+3
-1
lines changed

1 file changed

+3
-1
lines changed

async/pool.py

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -508,5 +508,7 @@ def add_task(self, task):
508508
class ThreadPool(Pool):
509509
"""A pool using threads as worker"""
510510
WorkerCls = WorkerThread
511-
LockCls = Lock
511+
# NOTE: Since threading.Lock is a method not a class, we need to prevent
512+
# conversion to an unbound method.
513+
LockCls = staticmethod(Lock)
512514
TaskQueueCls = AsyncQueue

0 commit comments

Comments
 (0)