File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -677,6 +677,11 @@ Changes in Python behavior
677677Changes in the Python API
678678-------------------------
679679
680+ * :mod: `asyncio `: The module doesn't export :mod: `selectors ` and
681+ :mod: `_overlapped ` modules as ``asyncio.selectors `` and
682+ ``asyncio._overlapped ``. Replace ``from asyncio import selectors `` with
683+ ``import selectors `` for example.
684+
680685* :meth: `pkgutil.walk_packages ` now raises ValueError if *path * is a string.
681686 Previously an empty list was returned. (Contributed by Sanyam Khurana in
682687 :issue: `24744 `.)
Original file line number Diff line number Diff line change 22
33import sys
44
5- # The selectors module is in the stdlib in Python 3.4 but not in 3.3.
6- # Do this first, so the other submodules can use "from . import selectors".
7- # Prefer asyncio/selectors.py over the stdlib one, as ours may be newer.
8- try :
9- from . import selectors
10- except ImportError :
11- import selectors # Will also be exported.
12-
13- if sys .platform == 'win32' :
14- # Similar thing for _overlapped.
15- try :
16- from . import _overlapped
17- except ImportError :
18- import _overlapped # Will also be exported.
19-
205# This relies on each of the submodules having an __all__ variable.
216from .base_events import *
227from .coroutines import *
Original file line number Diff line number Diff line change 99import collections
1010import errno
1111import functools
12+ import selectors
1213import socket
1314import warnings
1415import weakref
2122from . import constants
2223from . import events
2324from . import futures
24- from . import selectors
2525from . import transports
2626from . import sslproto
2727from .coroutines import coroutine
Original file line number Diff line number Diff line change 66import logging
77import os
88import re
9+ import selectors
910import socket
1011import socketserver
1112import sys
2829from . import base_events
2930from . import events
3031from . import futures
31- from . import selectors
3232from . import tasks
3333from .coroutines import coroutine
3434from .log import logger
Original file line number Diff line number Diff line change 22
33import errno
44import os
5+ import selectors
56import signal
67import socket
78import stat
1819from . import events
1920from . import futures
2021from . import selector_events
21- from . import selectors
2222from . import transports
2323from .coroutines import coroutine
2424from .log import logger
Original file line number Diff line number Diff line change 11"""Selector and proactor event loops for Windows."""
22
3+ import _overlapped
34import _winapi
45import errno
56import math
1415from . import selector_events
1516from . import tasks
1617from . import windows_utils
17- from . import _overlapped
1818from .coroutines import coroutine
1919from .log import logger
2020
Original file line number Diff line number Diff line change @@ -2141,7 +2141,7 @@ def test_create_datagram_endpoint(self):
21412141 def test_remove_fds_after_closing (self ):
21422142 raise unittest .SkipTest ("IocpEventLoop does not have add_reader()" )
21432143else :
2144- from asyncio import selectors
2144+ import selectors
21452145
21462146 class UnixEventLoopTestsMixin (EventLoopTestsMixin ):
21472147 def setUp (self ):
Original file line number Diff line number Diff line change 11"""Tests for selector_events.py"""
22
33import errno
4+ import selectors
45import socket
56import unittest
67from unittest import mock
1011 ssl = None
1112
1213import asyncio
13- from asyncio import selectors
1414from asyncio import test_utils
1515from asyncio .selector_events import BaseSelectorEventLoop
1616from asyncio .selector_events import _SelectorTransport
Original file line number Diff line number Diff line change 77if sys .platform != 'win32' :
88 raise unittest .SkipTest ('Windows only' )
99
10+ import _overlapped
1011import _winapi
1112
1213import asyncio
13- from asyncio import _overlapped
1414from asyncio import test_utils
1515from asyncio import windows_events
1616
Original file line number Diff line number Diff line change 99if sys .platform != 'win32' :
1010 raise unittest .SkipTest ('Windows only' )
1111
12+ import _overlapped
1213import _winapi
1314
14- from asyncio import _overlapped
1515from asyncio import windows_utils
1616try :
1717 from test import support
You can’t perform that action at this time.
0 commit comments