def testWithBoundedSemaphore(self):
lock = threading.BoundedSemaphore()
def locked():
if lock.acquire(False):
lock.release()
return False
else:
return True
self.boilerPlate(lock, locked)
# This is needed to make the test actually run under regrtest.py!
test_contextlib.py 文件源码
python
阅读 26
收藏 0
点赞 0
评论 0
评论列表
文章目录