Skip to content

Commit 50deffe

Browse files
committed
compat patch for asyncio.run
1 parent dce6713 commit 50deffe

1 file changed

Lines changed: 9 additions & 0 deletions

File tree

tests/conftest.py

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -10,6 +10,15 @@
1010
import inspect
1111

1212
# Hacks for <3.7
13+
if not hasattr(asyncio, 'run'):
14+
15+
def run(main, *, debug=False):
16+
loop = asyncio.new_event_loop()
17+
loop.set_debug(debug)
18+
return loop.run(main)
19+
20+
asyncio.current_task = current_task
21+
1322
if not hasattr(asyncio, 'current_task'):
1423

1524
def current_task(loop=None):

0 commit comments

Comments
 (0)