]> granicus.if.org Git - python/commitdiff
Fix asyncio.__all__: export also unix_events and windows_events symbols
authorVictor Stinner <victor.stinner@gmail.com>
Fri, 18 Jul 2014 10:44:25 +0000 (12:44 +0200)
committerVictor Stinner <victor.stinner@gmail.com>
Fri, 18 Jul 2014 10:44:25 +0000 (12:44 +0200)
For example, on Windows, it was not possible to get ProactorEventLoop or
DefaultEventLoopPolicy using "from asyncio import *".

Lib/asyncio/__init__.py

index 789424e41a3bb1835cda35cd1eb68f5a2d3467c0..3911fb40829577edfb2aeea20436ebf17067e370 100644 (file)
@@ -29,12 +29,6 @@ from .subprocess import *
 from .tasks import *
 from .transports import *
 
-if sys.platform == 'win32':  # pragma: no cover
-    from .windows_events import *
-else:
-    from .unix_events import *  # pragma: no cover
-
-
 __all__ = (coroutines.__all__ +
            events.__all__ +
            futures.__all__ +
@@ -45,3 +39,10 @@ __all__ = (coroutines.__all__ +
            subprocess.__all__ +
            tasks.__all__ +
            transports.__all__)
+
+if sys.platform == 'win32':  # pragma: no cover
+    from .windows_events import *
+    __all__ += windows_events.__all__
+else:
+    from .unix_events import *  # pragma: no cover
+    __all__ += unix_events.__all__