Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 5 additions & 0 deletions Doc/whatsnew/3.7.rst
Original file line number Diff line number Diff line change
Expand Up @@ -677,6 +677,11 @@ Changes in Python behavior
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`.)
Expand Down
15 changes: 0 additions & 15 deletions Lib/asyncio/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -2,21 +2,6 @@

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 *
Expand Down
2 changes: 1 addition & 1 deletion Lib/asyncio/selector_events.py
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,7 @@
import collections
import errno
import functools
import selectors
import socket
import warnings
import weakref
Expand All @@ -21,7 +22,6 @@
from . import constants
from . import events
from . import futures
from . import selectors
from . import transports
from . import sslproto
from .coroutines import coroutine
Expand Down
2 changes: 1 addition & 1 deletion Lib/asyncio/test_utils.py
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@
import logging
import os
import re
import selectors
import socket
import socketserver
import sys
Expand All @@ -28,7 +29,6 @@
from . import base_events
from . import events
from . import futures
from . import selectors
from . import tasks
from .coroutines import coroutine
from .log import logger
Expand Down
2 changes: 1 addition & 1 deletion Lib/asyncio/unix_events.py
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@

import errno
import os
import selectors
import signal
import socket
import stat
Expand All @@ -18,7 +19,6 @@
from . import events
from . import futures
from . import selector_events
from . import selectors
from . import transports
from .coroutines import coroutine
from .log import logger
Expand Down
2 changes: 1 addition & 1 deletion Lib/asyncio/windows_events.py
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
"""Selector and proactor event loops for Windows."""

import _overlapped
import _winapi
import errno
import math
Expand All @@ -14,7 +15,6 @@
from . import selector_events
from . import tasks
from . import windows_utils
from . import _overlapped
from .coroutines import coroutine
from .log import logger

Expand Down
2 changes: 1 addition & 1 deletion Lib/test/test_asyncio/test_events.py
Original file line number Diff line number Diff line change
Expand Up @@ -2141,7 +2141,7 @@ def test_create_datagram_endpoint(self):
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):
Expand Down
2 changes: 1 addition & 1 deletion Lib/test/test_asyncio/test_selector_events.py
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
"""Tests for selector_events.py"""

import errno
import selectors
import socket
import unittest
from unittest import mock
Expand All @@ -10,7 +11,6 @@
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
Expand Down
2 changes: 1 addition & 1 deletion Lib/test/test_asyncio/test_windows_events.py
Original file line number Diff line number Diff line change
Expand Up @@ -7,10 +7,10 @@
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

Expand Down
2 changes: 1 addition & 1 deletion Lib/test/test_asyncio/test_windows_utils.py
Original file line number Diff line number Diff line change
Expand Up @@ -9,9 +9,9 @@
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
Expand Down