Changes in the Python API
-------------------------
+* :mod:`asyncio`: The module doesn't export :mod:`selectors` and
+ :mod:`_overlapped` modules as ``asyncio.selectors`` and
+ ``asyncio._overlapped``. Replace ``from asyncio import selectors`` with
+ ``import selectors`` for example.
+
* :meth:`pkgutil.walk_packages` now raises ValueError if *path* is a string.
Previously an empty list was returned. (Contributed by Sanyam Khurana in
:issue:`24744`.)
import sys
-# The selectors module is in the stdlib in Python 3.4 but not in 3.3.
-# Do this first, so the other submodules can use "from . import selectors".
-# Prefer asyncio/selectors.py over the stdlib one, as ours may be newer.
-try:
- from . import selectors
-except ImportError:
- import selectors # Will also be exported.
-
-if sys.platform == 'win32':
- # Similar thing for _overlapped.
- try:
- from . import _overlapped
- except ImportError:
- import _overlapped # Will also be exported.
-
# This relies on each of the submodules having an __all__ variable.
from .base_events import *
from .coroutines import *
import collections
import errno
import functools
+import selectors
import socket
import warnings
import weakref
from . import constants
from . import events
from . import futures
-from . import selectors
from . import transports
from . import sslproto
from .coroutines import coroutine
import logging
import os
import re
+import selectors
import socket
import socketserver
import sys
from . import base_events
from . import events
from . import futures
-from . import selectors
from . import tasks
from .coroutines import coroutine
from .log import logger
import errno
import os
+import selectors
import signal
import socket
import stat
from . import events
from . import futures
from . import selector_events
-from . import selectors
from . import transports
from .coroutines import coroutine
from .log import logger
"""Selector and proactor event loops for Windows."""
+import _overlapped
import _winapi
import errno
import math
from . import selector_events
from . import tasks
from . import windows_utils
-from . import _overlapped
from .coroutines import coroutine
from .log import logger
def test_remove_fds_after_closing(self):
raise unittest.SkipTest("IocpEventLoop does not have add_reader()")
else:
- from asyncio import selectors
+ import selectors
class UnixEventLoopTestsMixin(EventLoopTestsMixin):
def setUp(self):
"""Tests for selector_events.py"""
import errno
+import selectors
import socket
import unittest
from unittest import mock
ssl = None
import asyncio
-from asyncio import selectors
from asyncio import test_utils
from asyncio.selector_events import BaseSelectorEventLoop
from asyncio.selector_events import _SelectorTransport
if sys.platform != 'win32':
raise unittest.SkipTest('Windows only')
+import _overlapped
import _winapi
import asyncio
-from asyncio import _overlapped
from asyncio import test_utils
from asyncio import windows_events
if sys.platform != 'win32':
raise unittest.SkipTest('Windows only')
+import _overlapped
import _winapi
-from asyncio import _overlapped
from asyncio import windows_utils
try:
from test import support