From 70d28a184c42d107cc8c69a95aa52a4469e7929c Mon Sep 17 00:00:00 2001 From: Serhiy Storchaka Date: Fri, 16 Dec 2016 20:00:15 +0200 Subject: [PATCH] Remove unused imports. --- Lib/asyncio/base_events.py | 1 - Lib/http/client.py | 1 - Lib/idlelib/idle_test/test_macosx.py | 1 - Lib/idlelib/idle_test/test_tree.py | 1 - Lib/idlelib/macosx.py | 1 - Lib/idlelib/stackviewer.py | 1 - Lib/lib2to3/pytree.py | 1 - Lib/lib2to3/tests/__init__.py | 1 - Lib/modulefinder.py | 1 - Lib/socketserver.py | 1 - Lib/test/support/script_helper.py | 3 --- Lib/test/test_asyncgen.py | 1 - Lib/test/test_asyncio/test_tasks.py | 1 - Lib/test/test_asyncio/test_unix_events.py | 1 - Lib/test/test_bz2.py | 1 - Lib/test/test_cmd.py | 1 - Lib/test/test_cmd_line.py | 1 - Lib/test/test_configparser.py | 1 - Lib/test/test_dbm_dumb.py | 1 - Lib/test/test_decimal.py | 2 -- Lib/test/test_dis.py | 1 - Lib/test/test_faulthandler.py | 1 - Lib/test/test_frame.py | 2 -- Lib/test/test_import/__init__.py | 1 - Lib/test/test_importlib/abc.py | 1 - Lib/test/test_importlib/test_abc.py | 2 -- Lib/test/test_inspect.py | 3 --- Lib/test/test_os.py | 1 - Lib/test/test_peepholer.py | 3 --- Lib/test/test_raise.py | 1 - Lib/test/test_re.py | 3 --- Lib/test/test_set.py | 1 - Lib/test/test_shutil.py | 1 - Lib/test/test_signal.py | 4 ---- Lib/test/test_ssl.py | 1 - Lib/test/test_subclassinit.py | 1 - Lib/test/test_super.py | 1 - Lib/test/test_timeit.py | 1 - Lib/test/test_unicode_identifiers.py | 1 - Lib/test/test_winsound.py | 2 -- Lib/test/test_yield_from.py | 3 --- Lib/urllib/request.py | 1 - Lib/zipfile.py | 1 - 43 files changed, 60 deletions(-) diff --git a/Lib/asyncio/base_events.py b/Lib/asyncio/base_events.py index 0df58c5f873..ee34996c8aa 100644 --- a/Lib/asyncio/base_events.py +++ b/Lib/asyncio/base_events.py @@ -16,7 +16,6 @@ to modify the meaning of the API call itself. import collections import concurrent.futures import heapq -import inspect import itertools import logging import os diff --git a/Lib/http/client.py b/Lib/http/client.py index 59237a3b31a..0234199dfa9 100644 --- a/Lib/http/client.py +++ b/Lib/http/client.py @@ -72,7 +72,6 @@ import email.parser import email.message import http import io -import os import re import socket import collections diff --git a/Lib/idlelib/idle_test/test_macosx.py b/Lib/idlelib/idle_test/test_macosx.py index fae75d8a497..775697b278d 100644 --- a/Lib/idlelib/idle_test/test_macosx.py +++ b/Lib/idlelib/idle_test/test_macosx.py @@ -4,7 +4,6 @@ Coverage: 71% on Windows. ''' from idlelib import macosx from test.support import requires -import sys import tkinter as tk import unittest import unittest.mock as mock diff --git a/Lib/idlelib/idle_test/test_tree.py b/Lib/idlelib/idle_test/test_tree.py index 09ba9641af5..bb597d87ffd 100644 --- a/Lib/idlelib/idle_test/test_tree.py +++ b/Lib/idlelib/idle_test/test_tree.py @@ -5,7 +5,6 @@ Coverage: 56% from idlelib import tree from test.support import requires requires('gui') -import os import unittest from tkinter import Tk diff --git a/Lib/idlelib/macosx.py b/Lib/idlelib/macosx.py index c225dd9e1a1..d4566cd815a 100644 --- a/Lib/idlelib/macosx.py +++ b/Lib/idlelib/macosx.py @@ -2,7 +2,6 @@ A number of functions that enhance IDLE on Mac OSX. """ from sys import platform # Used in _init_tk_type, changed by test. -import warnings import tkinter diff --git a/Lib/idlelib/stackviewer.py b/Lib/idlelib/stackviewer.py index 0698def5d4c..400fa632a09 100644 --- a/Lib/idlelib/stackviewer.py +++ b/Lib/idlelib/stackviewer.py @@ -1,6 +1,5 @@ import linecache import os -import re import sys import tkinter as tk diff --git a/Lib/lib2to3/pytree.py b/Lib/lib2to3/pytree.py index ad3592c05f7..c425fe68274 100644 --- a/Lib/lib2to3/pytree.py +++ b/Lib/lib2to3/pytree.py @@ -13,7 +13,6 @@ There's also a pattern matching implementation here. __author__ = "Guido van Rossum " import sys -import warnings from io import StringIO HUGE = 0x7FFFFFFF # maximum repeat count, default max diff --git a/Lib/lib2to3/tests/__init__.py b/Lib/lib2to3/tests/__init__.py index c5166fc94c4..54221c79943 100644 --- a/Lib/lib2to3/tests/__init__.py +++ b/Lib/lib2to3/tests/__init__.py @@ -1,7 +1,6 @@ # Author: Collin Winter import os -import unittest from test.support import load_package_tests diff --git a/Lib/modulefinder.py b/Lib/modulefinder.py index e220315253b..e277ca72f8e 100644 --- a/Lib/modulefinder.py +++ b/Lib/modulefinder.py @@ -7,7 +7,6 @@ import marshal import os import sys import types -import struct import warnings with warnings.catch_warnings(): warnings.simplefilter('ignore', DeprecationWarning) diff --git a/Lib/socketserver.py b/Lib/socketserver.py index 41a37667721..6e1ae9fddda 100644 --- a/Lib/socketserver.py +++ b/Lib/socketserver.py @@ -126,7 +126,6 @@ __version__ = "0.4" import socket import selectors import os -import errno import sys try: import threading diff --git a/Lib/test/support/script_helper.py b/Lib/test/support/script_helper.py index 80889b17f3f..2627a1ee68a 100644 --- a/Lib/test/support/script_helper.py +++ b/Lib/test/support/script_helper.py @@ -6,11 +6,8 @@ import importlib import sys import os import os.path -import tempfile import subprocess import py_compile -import contextlib -import shutil import zipfile from importlib.util import source_from_cache diff --git a/Lib/test/test_asyncgen.py b/Lib/test/test_asyncgen.py index 34ab8a04eee..2b7c5d0d35c 100644 --- a/Lib/test/test_asyncgen.py +++ b/Lib/test/test_asyncgen.py @@ -1,5 +1,4 @@ import inspect -import sys import types import unittest diff --git a/Lib/test/test_asyncio/test_tasks.py b/Lib/test/test_asyncio/test_tasks.py index a18d49ae374..fdf91a36b5e 100644 --- a/Lib/test/test_asyncio/test_tasks.py +++ b/Lib/test/test_asyncio/test_tasks.py @@ -7,7 +7,6 @@ import io import os import re import sys -import time import types import unittest import weakref diff --git a/Lib/test/test_asyncio/test_unix_events.py b/Lib/test/test_asyncio/test_unix_events.py index 5a499841352..11f0890d65f 100644 --- a/Lib/test/test_asyncio/test_unix_events.py +++ b/Lib/test/test_asyncio/test_unix_events.py @@ -12,7 +12,6 @@ import sys import tempfile import threading import unittest -import warnings from unittest import mock if sys.platform == 'win32': diff --git a/Lib/test/test_bz2.py b/Lib/test/test_bz2.py index eaa472a6ccd..e76b2832613 100644 --- a/Lib/test/test_bz2.py +++ b/Lib/test/test_bz2.py @@ -10,7 +10,6 @@ import pathlib import random import shutil import subprocess -import sys from test.support import unlink import _compression diff --git a/Lib/test/test_cmd.py b/Lib/test/test_cmd.py index dd8981f8935..99a483be43b 100644 --- a/Lib/test/test_cmd.py +++ b/Lib/test/test_cmd.py @@ -6,7 +6,6 @@ Original by Michael Schneider import cmd import sys -import re import unittest import io from test import support diff --git a/Lib/test/test_cmd_line.py b/Lib/test/test_cmd_line.py index ae2bcd43754..958d282a428 100644 --- a/Lib/test/test_cmd_line.py +++ b/Lib/test/test_cmd_line.py @@ -4,7 +4,6 @@ import test.support, unittest import os -import shutil import sys import subprocess import tempfile diff --git a/Lib/test/test_configparser.py b/Lib/test/test_configparser.py index 0d06080da33..696f642621e 100644 --- a/Lib/test/test_configparser.py +++ b/Lib/test/test_configparser.py @@ -2,7 +2,6 @@ import collections import configparser import io import os -import sys import textwrap import unittest import warnings diff --git a/Lib/test/test_dbm_dumb.py b/Lib/test/test_dbm_dumb.py index c2703d7e0b6..73f2a32a7b4 100644 --- a/Lib/test/test_dbm_dumb.py +++ b/Lib/test/test_dbm_dumb.py @@ -7,7 +7,6 @@ import operator import os import stat import unittest -import warnings import dbm.dumb as dumbdbm from test import support from functools import partial diff --git a/Lib/test/test_decimal.py b/Lib/test/test_decimal.py index 617a37eec82..59a17af278c 100644 --- a/Lib/test/test_decimal.py +++ b/Lib/test/test_decimal.py @@ -37,8 +37,6 @@ from test.support import (run_unittest, run_doctest, is_resource_enabled, from test.support import (check_warnings, import_fresh_module, TestFailed, run_with_locale, cpython_only) import random -import time -import warnings import inspect try: import threading diff --git a/Lib/test/test_dis.py b/Lib/test/test_dis.py index b9b5ac2667e..980ae16c652 100644 --- a/Lib/test/test_dis.py +++ b/Lib/test/test_dis.py @@ -2,7 +2,6 @@ from test.support import captured_stdout from test.bytecode_helper import BytecodeTestCase -import difflib import unittest import sys import dis diff --git a/Lib/test/test_faulthandler.py b/Lib/test/test_faulthandler.py index 67219c16eac..28dd5f4e98f 100644 --- a/Lib/test/test_faulthandler.py +++ b/Lib/test/test_faulthandler.py @@ -2,7 +2,6 @@ from contextlib import contextmanager import datetime import faulthandler import os -import re import signal import subprocess import sys diff --git a/Lib/test/test_frame.py b/Lib/test/test_frame.py index 189fca90fee..cabfef236dd 100644 --- a/Lib/test/test_frame.py +++ b/Lib/test/test_frame.py @@ -1,5 +1,3 @@ -import gc -import sys import types import unittest import weakref diff --git a/Lib/test/test_import/__init__.py b/Lib/test/test_import/__init__.py index 760908efe67..d61782a6cb9 100644 --- a/Lib/test/test_import/__init__.py +++ b/Lib/test/test_import/__init__.py @@ -14,7 +14,6 @@ import unittest import unittest.mock as mock import textwrap import errno -import shutil import contextlib import test.support diff --git a/Lib/test/test_importlib/abc.py b/Lib/test/test_importlib/abc.py index 2070dadc235..5d4b9587676 100644 --- a/Lib/test/test_importlib/abc.py +++ b/Lib/test/test_importlib/abc.py @@ -1,5 +1,4 @@ import abc -import unittest class FinderTests(metaclass=abc.ABCMeta): diff --git a/Lib/test/test_importlib/test_abc.py b/Lib/test/test_importlib/test_abc.py index c86248047fd..4c090f32de3 100644 --- a/Lib/test/test_importlib/test_abc.py +++ b/Lib/test/test_importlib/test_abc.py @@ -1,5 +1,3 @@ -import contextlib -import inspect import io import marshal import os diff --git a/Lib/test/test_inspect.py b/Lib/test/test_inspect.py index 97634e591ca..1be9a125fa3 100644 --- a/Lib/test/test_inspect.py +++ b/Lib/test/test_inspect.py @@ -10,7 +10,6 @@ import os from os.path import normcase import _pickle import pickle -import re import shutil import sys import types @@ -56,8 +55,6 @@ modfile = normcase(modfile) def revise(filename, *args): return (normcase(filename),) + args -import builtins - git = mod.StupidGit() class IsTestBase(unittest.TestCase): diff --git a/Lib/test/test_os.py b/Lib/test/test_os.py index e9fdb0719f4..cb15234079f 100644 --- a/Lib/test/test_os.py +++ b/Lib/test/test_os.py @@ -15,7 +15,6 @@ import locale import mmap import os import pickle -import re import shutil import signal import socket diff --git a/Lib/test/test_peepholer.py b/Lib/test/test_peepholer.py index b0336407c3b..efc0afecf5a 100644 --- a/Lib/test/test_peepholer.py +++ b/Lib/test/test_peepholer.py @@ -1,7 +1,4 @@ import dis -import re -import sys -import textwrap import unittest from test.bytecode_helper import BytecodeTestCase diff --git a/Lib/test/test_raise.py b/Lib/test/test_raise.py index a41b3537787..c6d80b078e5 100644 --- a/Lib/test/test_raise.py +++ b/Lib/test/test_raise.py @@ -4,7 +4,6 @@ """Tests for the raise statement.""" from test import support -import re import sys import types import unittest diff --git a/Lib/test/test_re.py b/Lib/test/test_re.py index 6896b4dcbef..c90bdc9609d 100644 --- a/Lib/test/test_re.py +++ b/Lib/test/test_re.py @@ -1,12 +1,9 @@ from test.support import verbose, run_unittest, gc_collect, bigmemtest, _2G, \ cpython_only, captured_stdout -import io import locale import re import sre_compile import string -import sys -import traceback import unittest import warnings from re import Scanner diff --git a/Lib/test/test_set.py b/Lib/test/test_set.py index 0202981d67e..bb1081f034f 100644 --- a/Lib/test/test_set.py +++ b/Lib/test/test_set.py @@ -10,7 +10,6 @@ import warnings import collections import collections.abc import itertools -import string class PassThru(Exception): pass diff --git a/Lib/test/test_shutil.py b/Lib/test/test_shutil.py index 2ad3a21c86d..3688eae9470 100644 --- a/Lib/test/test_shutil.py +++ b/Lib/test/test_shutil.py @@ -20,7 +20,6 @@ from shutil import (make_archive, SameFileError) import tarfile import zipfile -import warnings from test import support from test.support import (TESTFN, check_warnings, captured_stdout, diff --git a/Lib/test/test_signal.py b/Lib/test/test_signal.py index ab42ed70cc9..8a404ef7a92 100644 --- a/Lib/test/test_signal.py +++ b/Lib/test/test_signal.py @@ -1,15 +1,11 @@ import unittest from test import support from contextlib import closing -import enum -import gc -import pickle import select import signal import socket import struct import subprocess -import traceback import sys, os, time, errno from test.support.script_helper import assert_python_ok, spawn_python try: diff --git a/Lib/test/test_ssl.py b/Lib/test/test_ssl.py index d203cddbdfb..69a65d20a4d 100644 --- a/Lib/test/test_ssl.py +++ b/Lib/test/test_ssl.py @@ -11,7 +11,6 @@ import gc import os import errno import pprint -import tempfile import urllib.request import traceback import asyncore diff --git a/Lib/test/test_subclassinit.py b/Lib/test/test_subclassinit.py index 3c331bb98fc..0ad7d17fbd4 100644 --- a/Lib/test/test_subclassinit.py +++ b/Lib/test/test_subclassinit.py @@ -1,4 +1,3 @@ -import sys import types import unittest diff --git a/Lib/test/test_super.py b/Lib/test/test_super.py index 447dec9130f..cb2d7c32236 100644 --- a/Lib/test/test_super.py +++ b/Lib/test/test_super.py @@ -1,6 +1,5 @@ """Unit tests for zero-argument super() & related machinery.""" -import sys import unittest import warnings from test.support import check_warnings diff --git a/Lib/test/test_timeit.py b/Lib/test/test_timeit.py index 8d4746a36e0..e02d4a71a9b 100644 --- a/Lib/test/test_timeit.py +++ b/Lib/test/test_timeit.py @@ -2,7 +2,6 @@ import timeit import unittest import sys import io -import time from textwrap import dedent from test.support import captured_stdout diff --git a/Lib/test/test_unicode_identifiers.py b/Lib/test/test_unicode_identifiers.py index 0679845238f..07332c46319 100644 --- a/Lib/test/test_unicode_identifiers.py +++ b/Lib/test/test_unicode_identifiers.py @@ -1,5 +1,4 @@ import unittest -import sys class PEP3131Test(unittest.TestCase): diff --git a/Lib/test/test_winsound.py b/Lib/test/test_winsound.py index 179e069a1cc..c86bf553fd8 100644 --- a/Lib/test/test_winsound.py +++ b/Lib/test/test_winsound.py @@ -1,8 +1,6 @@ # Ridiculously simple test of the winsound module for Windows. import functools -import os -import subprocess import time import unittest diff --git a/Lib/test/test_yield_from.py b/Lib/test/test_yield_from.py index 7e9711eaf5c..d1da838ac71 100644 --- a/Lib/test/test_yield_from.py +++ b/Lib/test/test_yield_from.py @@ -8,10 +8,7 @@ see