bpo-32154: Remove asyncio.selectors (#4605)

* Remove asyncio.selectors and asyncio._overlapped symbols from the
  namespace of the asyncio module
* Replace "from asyncio import selectors" with "import selectors"
* Replace "from asyncio import _overlapped" with "import _overlapped"

asyncio.selectors was added to support Python 3.3, which doesn't have
selectors in its standard library, and Python 3.4 in the same code
base. Same rationale for asyncio._overlapped. Python 3.3 reached its
end of life, and asyncio is no more maintained as a third party
module on PyPI.
This commit is contained in:
Victor Stinner 2017-11-28 15:19:56 +01:00 committed by GitHub
parent 3f438a9fa0
commit 4271dfd781
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
10 changed files with 13 additions and 23 deletions

View file

@ -2141,7 +2141,7 @@ if sys.platform == 'win32':
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):

View file

@ -1,6 +1,7 @@
"""Tests for selector_events.py"""
import errno
import selectors
import socket
import unittest
from unittest import mock
@ -10,7 +11,6 @@ except ImportError:
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

View file

@ -7,10 +7,10 @@ from unittest import mock
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

View file

@ -9,9 +9,9 @@ from unittest import mock
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