Update nest-asyncio/README.md
This commit is contained in:
@@ -1,5 +1,4 @@
|
|||||||
```python
|
```python
|
||||||
''
|
|
||||||
import asyncio
|
import asyncio
|
||||||
(loop := asyncio.get_event_loop()).__class__._check_running = lambda _: None
|
(loop := asyncio.get_event_loop()).__class__._check_running = lambda _: None
|
||||||
def _run_once(self):
|
def _run_once(self):
|
||||||
@@ -10,7 +9,7 @@ def _run_once(self):
|
|||||||
tasks[self] = task
|
tasks[self] = task
|
||||||
loop.__class__._run_once = _run_once
|
loop.__class__._run_once = _run_once
|
||||||
asyncio.run = loop.run_until_complete
|
asyncio.run = loop.run_until_complete
|
||||||
''
|
|
||||||
async def hello():
|
async def hello():
|
||||||
async def world(): print('hello')
|
async def world(): print('hello')
|
||||||
asyncio.run(world()) or print('world')
|
asyncio.run(world()) or print('world')
|
||||||
|
|||||||
Reference in New Issue
Block a user