From 70d28a184c42d107cc8c69a95aa52a4469e7929c Mon Sep 17 00:00:00 2001 From: Serhiy Storchaka Date: Fri, 16 Dec 2016 20:00:15 +0200 Subject: 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 0df58c5..ee34996 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 59237a3..0234199 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 fae75d8..775697b 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 09ba964..bb597d8 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 c225dd9..d4566cd 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 0698def..400fa63 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 ad3592c..c425fe6 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 c5166fc..54221c7 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 e220315..e277ca7 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 41a3766..6e1ae9f 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 80889b1..2627a1e 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 34ab8a0..2b7c5d0 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 a18d49a..fdf91a3 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 5a49984..11f0890 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 eaa472a..e76b283 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 dd8981f..99a483b 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 ae2bcd4..958d282 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 0d06080..696f642 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 c2703d7..73f2a32 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 617a37e..59a17af 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 b9b5ac2..980ae16 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 67219c1..28dd5f4 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 189fca9..cabfef2 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 760908e..d61782a 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 2070dad..5d4b958 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 c862480..4c090f3 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 97634e5..1be9a12 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 e9fdb07..cb15234 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 b033640..efc0afe 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 a41b353..c6d80b0 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 6896b4d..c90bdc9 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 0202981..bb1081f 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 2ad3a21..3688eae 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 ab42ed7..8a404ef 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 d203cdd..69a65d2 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 3c331bb9..0ad7d17 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 447dec9..cb2d7c3 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 8d4746a..e02d4a7 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 0679845..07332c4 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 179e069..c86bf55 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 7e9711e..d1da838 100644 --- a/Lib/test/test_yield_from.py +++ b/Lib/test/test_yield_from.py @@ -8,10 +8,7 @@ see