This repository was archived by the owner on Nov 23, 2017. It is now read-only.
File tree 3 files changed +3
-30
lines changed
3 files changed +3
-30
lines changed Original file line number Diff line number Diff line change 42
42
subprocess .__all__ +
43
43
tasks .__all__ +
44
44
transports .__all__ +
45
- ['run' , 'forever' ]) # Will fix this later.
45
+ ['run' ]) # Will fix this later.
46
46
47
47
if sys .platform == 'win32' : # pragma: no cover
48
48
from .windows_events import *
Original file line number Diff line number Diff line change 1
1
"""asyncio.run() function."""
2
2
3
- __all__ = ['run' , 'forever' ]
3
+ __all__ = ['run' ]
4
4
5
5
import inspect
6
6
import threading
@@ -15,33 +15,6 @@ def _isasyncgen(obj):
15
15
return False
16
16
17
17
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
-
45
18
def run (coro , * , debug = False ):
46
19
"""Run a coroutine.
47
20
Original file line number Diff line number Diff line change @@ -302,7 +302,7 @@ def _step(self, exc=None):
302
302
def _wakeup (self , future ):
303
303
try :
304
304
future .result ()
305
- except BaseException as exc :
305
+ except Exception as exc :
306
306
# This may also be a cancellation.
307
307
self ._step (exc )
308
308
else :
You can’t perform that action at this time.
0 commit comments