[Python-checkins] cpython (merge 3.4 -> default): (Merge 3.4) Fix asyncio.__all__: export also unix_events and windows_events

victor.stinner python-checkins at python.org
Fri Jul 18 12:47:56 CEST 2014


http://hg.python.org/cpython/rev/0e4e3ba73f3c
changeset:   91724:0e4e3ba73f3c
parent:      91722:45e8eb53edbc
parent:      91723:82e0aca2cf9e
user:        Victor Stinner <victor.stinner at gmail.com>
date:        Fri Jul 18 12:47:14 2014 +0200
summary:
  (Merge 3.4) 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 *".

files:
  Lib/asyncio/__init__.py |  13 +++++++------
  1 files changed, 7 insertions(+), 6 deletions(-)


diff --git a/Lib/asyncio/__init__.py b/Lib/asyncio/__init__.py
--- a/Lib/asyncio/__init__.py
+++ b/Lib/asyncio/__init__.py
@@ -29,12 +29,6 @@
 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 @@
            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__

-- 
Repository URL: http://hg.python.org/cpython


More information about the Python-checkins mailing list