georgeyk/loafer

with await lock Deprecation on python 3.7

fmarcolino opened this issue ยท 1 comments

with await self._semaphore:

My pytest shows a deprecation on line 24 (It isn't supposed to fix it immediatelly):

DeprecationWarning: 'with await lock' is deprecated use 'async with lock' instead

๐Ÿ˜

Confirming this breaks when going from Python 3.8 => 3.9 with

fatal error caught: TypeError("object Semaphore can't be used in 'await' expression")

No error if i change to

        async with self._semaphore: