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