This repository was archived by the owner on Nov 23, 2017. It is now read-only.
File tree Expand file tree Collapse file tree 3 files changed +3
-30
lines changed
Expand file tree Collapse file tree 3 files changed +3
-30
lines changed Original file line number Diff line number Diff line change 4242 subprocess .__all__ +
4343 tasks .__all__ +
4444 transports .__all__ +
45- ['run' , 'forever' ]) # Will fix this later.
45+ ['run' ]) # Will fix this later.
4646
4747if sys .platform == 'win32' : # pragma: no cover
4848 from .windows_events import *
Original file line number Diff line number Diff line change 11"""asyncio.run() function."""
22
3- __all__ = ['run' , 'forever' ]
3+ __all__ = ['run' ]
44
55import inspect
66import threading
@@ -15,33 +15,6 @@ def _isasyncgen(obj):
1515 return False
1616
1717
18- @coroutines .coroutine
19- def forever ():
20- """Wait until the current event loop stops running.
21-
22- The coroutine will return None if the loop is stopped by
23- calling the `loop.stop()` method.
24-
25- The coroutine will propagate any exception that caused
26- the loop to stop;
27-
28- It is recommended to use this coroutine with the asyncio.run()
29- function:
30-
31- async def coro():
32- print('hi')
33- try:
34- await asyncio.forever()
35- except KeyboardInterrupt:
36- await asyncio.sleep(1)
37- print('bye')
38-
39- asyncio.run(coro())
40- """
41- loop = events .get_event_loop ()
42- return (yield from loop .get_forever_future ())
43-
44-
4518def run (coro , * , debug = False ):
4619 """Run a coroutine.
4720
Original file line number Diff line number Diff line change @@ -302,7 +302,7 @@ def _step(self, exc=None):
302302 def _wakeup (self , future ):
303303 try :
304304 future .result ()
305- except BaseException as exc :
305+ except Exception as exc :
306306 # This may also be a cancellation.
307307 self ._step (exc )
308308 else :
You can’t perform that action at this time.
0 commit comments