File tree Expand file tree Collapse file tree 1 file changed +13
-4
lines changed Expand file tree Collapse file tree 1 file changed +13
-4
lines changed Original file line number Diff line number Diff line change 22
33[case testAsync]
44import asyncio
5+ import sys
56
67async def h() -> int:
78 return 1
@@ -13,17 +14,25 @@ async def g() -> int:
1314async def f() -> int:
1415 return await g()
1516
16- loop = asyncio.get_event_loop()
17- result = loop.run_until_complete(f())
17+ if sys.version_info >= (3, 7):
18+ result = asyncio.run(f())
19+ else:
20+ loop = asyncio.get_event_loop()
21+ result = loop.run_until_complete(f())
1822assert result == 1
1923
2024[typing fixtures/typing-full.pyi]
2125
2226[file driver.py]
2327from native import f
2428import asyncio
25- loop = asyncio.get_event_loop()
26- result = loop.run_until_complete(f())
29+ import sys
30+
31+ if sys.version_info >= (3, 7):
32+ result = asyncio.run(f())
33+ else:
34+ loop = asyncio.get_event_loop()
35+ result = loop.run_until_complete(f())
2736assert result == 1
2837
2938[case testMaybeUninitVar]
You can’t perform that action at this time.
0 commit comments