diff options
Diffstat (limited to 'Lib')
-rw-r--r-- | Lib/importlib/resources.py | 3 | ||||
-rw-r--r-- | Lib/multiprocessing/pool.py | 1 | ||||
-rw-r--r-- | Lib/ssl.py | 2 | ||||
-rw-r--r-- | Lib/test/support/socket_helper.py | 10 | ||||
-rw-r--r-- | Lib/test/test__xxsubinterpreters.py | 20 | ||||
-rw-r--r-- | Lib/test/test_type_comments.py | 6 |
6 files changed, 8 insertions, 34 deletions
diff --git a/Lib/importlib/resources.py b/Lib/importlib/resources.py index fc3a1c9cab..f518865574 100644 --- a/Lib/importlib/resources.py +++ b/Lib/importlib/resources.py @@ -8,10 +8,9 @@ from importlib.abc import ResourceLoader from io import BytesIO, TextIOWrapper from pathlib import Path from types import ModuleType -from typing import Iterable, Iterator, Optional, Set, Union # noqa: F401 +from typing import Iterable, Iterator, Optional, Union # noqa: F401 from typing import cast from typing.io import BinaryIO, TextIO -from zipimport import ZipImportError __all__ = [ diff --git a/Lib/multiprocessing/pool.py b/Lib/multiprocessing/pool.py index b8a0b82763..bbe05a550c 100644 --- a/Lib/multiprocessing/pool.py +++ b/Lib/multiprocessing/pool.py @@ -22,7 +22,6 @@ import time import traceback import types import warnings -from queue import Empty # If threading is available then ThreadPool should be provided. Therefore # we avoid top-level imports which are liable to fail on some systems. diff --git a/Lib/ssl.py b/Lib/ssl.py index 0726caee49..30f4e5934f 100644 --- a/Lib/ssl.py +++ b/Lib/ssl.py @@ -252,7 +252,7 @@ class _TLSMessageType(_IntEnum): if sys.platform == "win32": from _ssl import enum_certificates, enum_crls -from socket import socket, AF_INET, SOCK_STREAM, create_connection +from socket import socket, SOCK_STREAM, create_connection from socket import SOL_SOCKET, SO_TYPE import socket as _socket import base64 # for DER-to-PEM translation diff --git a/Lib/test/support/socket_helper.py b/Lib/test/support/socket_helper.py index 0ac8445562..f709ffd40d 100644 --- a/Lib/test/support/socket_helper.py +++ b/Lib/test/support/socket_helper.py @@ -91,13 +91,15 @@ def bind_port(sock, host=HOST): if sock.family == socket.AF_INET and sock.type == socket.SOCK_STREAM: if hasattr(socket, 'SO_REUSEADDR'): if sock.getsockopt(socket.SOL_SOCKET, socket.SO_REUSEADDR) == 1: - raise TestFailed("tests should never set the SO_REUSEADDR " \ - "socket option on TCP/IP sockets!") + raise support.TestFailed("tests should never set the " + "SO_REUSEADDR socket option on " + "TCP/IP sockets!") if hasattr(socket, 'SO_REUSEPORT'): try: if sock.getsockopt(socket.SOL_SOCKET, socket.SO_REUSEPORT) == 1: - raise TestFailed("tests should never set the SO_REUSEPORT " \ - "socket option on TCP/IP sockets!") + raise support.TestFailed("tests should never set the " + "SO_REUSEPORT socket option on " + "TCP/IP sockets!") except OSError: # Python's socket module was compiled using modern headers # thus defining SO_REUSEPORT but this process is running diff --git a/Lib/test/test__xxsubinterpreters.py b/Lib/test/test__xxsubinterpreters.py index 44f4d3fa0f..80eff19152 100644 --- a/Lib/test/test__xxsubinterpreters.py +++ b/Lib/test/test__xxsubinterpreters.py @@ -19,12 +19,6 @@ interpreters = support.import_module('_xxsubinterpreters') ################################## # helpers -def powerset(*sets): - return itertools.chain.from_iterable( - combinations(sets, r) - for r in range(len(sets)+1)) - - def _captured_script(script): r, w = os.pipe() indented = script.replace('\n', '\n ') @@ -90,14 +84,6 @@ def _run_interp(id, source, shared, _mainns={}): interpreters.run_string(id, source, shared) -def run_interp_threaded(id, source, **shared): - def run(): - _run(id, source, shared) - t = threading.Thread(target=run) - t.start() - t.join() - - class Interpreter(namedtuple('Interpreter', 'name id')): @classmethod @@ -786,12 +772,6 @@ class RunStringTests(TestBase): self._fs.close() super().tearDown() - @property - def fs(self): - if self._fs is None: - self._fs = FSFixture(self) - return self._fs - def test_success(self): script, file = _captured_script('print("it worked!", end="")') with file: diff --git a/Lib/test/test_type_comments.py b/Lib/test/test_type_comments.py index 6c3f6ed4ed..6027b3b56f 100644 --- a/Lib/test/test_type_comments.py +++ b/Lib/test/test_type_comments.py @@ -252,7 +252,6 @@ class TypeCommentTests(unittest.TestCase): self.assertEqual(tree.body[0].type_comment, None) self.assertEqual(tree.body[1].type_comment, None) - @support.skip_if_new_parser("Pegen does not support feature_version yet") def test_asyncdef(self): for tree in self.parse_all(asyncdef, minver=5): self.assertEqual(tree.body[0].type_comment, "() -> int") @@ -261,27 +260,22 @@ class TypeCommentTests(unittest.TestCase): self.assertEqual(tree.body[0].type_comment, None) self.assertEqual(tree.body[1].type_comment, None) - @support.skip_if_new_parser("Pegen does not support feature_version yet") def test_asyncvar(self): for tree in self.parse_all(asyncvar, maxver=6): pass - @support.skip_if_new_parser("Pegen does not support feature_version yet") def test_asynccomp(self): for tree in self.parse_all(asynccomp, minver=6): pass - @support.skip_if_new_parser("Pegen does not support feature_version yet") def test_matmul(self): for tree in self.parse_all(matmul, minver=5): pass - @support.skip_if_new_parser("Pegen does not support feature_version yet") def test_fstring(self): for tree in self.parse_all(fstring, minver=6): pass - @support.skip_if_new_parser("Pegen does not support feature_version yet") def test_underscorednumber(self): for tree in self.parse_all(underscorednumber, minver=6): pass |