Skip to content
This repository was archived by the owner on Apr 14, 2024. It is now read-only.

Commit b99158c

Browse files
committed
Fix issue #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

+3-1
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)