Skip to content
This repository was archived by the owner on Nov 23, 2017. It is now read-only.

Commit fa721ee

Browse files
committed
Rollback all changes to tasks.py; drop forever
1 parent f24ff30 commit fa721ee

File tree

3 files changed

+3
-30
lines changed

3 files changed

+3
-30
lines changed

asyncio/__init__.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -42,7 +42,7 @@
4242
subprocess.__all__ +
4343
tasks.__all__ +
4444
transports.__all__ +
45-
['run', 'forever']) # Will fix this later.
45+
['run']) # Will fix this later.
4646

4747
if sys.platform == 'win32': # pragma: no cover
4848
from .windows_events import *

asyncio/run.py

Lines changed: 1 addition & 28 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
"""asyncio.run() function."""
22

3-
__all__ = ['run', 'forever']
3+
__all__ = ['run']
44

55
import inspect
66
import 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-
4518
def run(coro, *, debug=False):
4619
"""Run a coroutine.
4720

asyncio/tasks.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff 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:

0 commit comments

Comments
 (0)