Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Commit be0a2d7

Browse files
committed
Fix asyncio.__all__: export also unix_events and windows_events symbols
For example, on Windows, it was not possible to get ProactorEventLoop or DefaultEventLoopPolicy using "from asyncio import *".
1 parent 98fa332 commit be0a2d7

1 file changed

Lines changed: 7 additions & 6 deletions

File tree

Lib/asyncio/__init__.py

Lines changed: 7 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -29,12 +29,6 @@
2929
from .tasks import *
3030
from .transports import *
3131

32-
if sys.platform == 'win32': # pragma: no cover
33-
from .windows_events import *
34-
else:
35-
from .unix_events import * # pragma: no cover
36-
37-
3832
__all__ = (coroutines.__all__ +
3933
events.__all__ +
4034
futures.__all__ +
@@ -45,3 +39,10 @@
4539
subprocess.__all__ +
4640
tasks.__all__ +
4741
transports.__all__)
42+
43+
if sys.platform == 'win32': # pragma: no cover
44+
from .windows_events import *
45+
__all__ += windows_events.__all__
46+
else:
47+
from .unix_events import * # pragma: no cover
48+
__all__ += unix_events.__all__

0 commit comments

Comments
 (0)