From c5f05e45cffa16f45f1332cec531c045893f928f Mon Sep 17 00:00:00 2001 From: Christian Heimes Date: Sat, 23 Feb 2008 17:40:11 +0000 Subject: [PATCH] Patch #2167 from calvin: Remove unused imports --- Lib/SimpleHTTPServer.py | 1 - Lib/bsddb/test/test_basics.py | 1 - Lib/bsddb/test/test_compat.py | 2 +- Lib/bsddb/test/test_cursor_pget_bug.py | 2 +- Lib/bsddb/test/test_dbobj.py | 2 +- Lib/bsddb/test/test_dbshelve.py | 3 +-- Lib/bsddb/test/test_dbtables.py | 2 +- Lib/bsddb/test/test_env_close.py | 1 - Lib/bsddb/test/test_get_none.py | 3 +-- Lib/bsddb/test/test_join.py | 4 +--- Lib/bsddb/test/test_lock.py | 3 --- Lib/bsddb/test/test_misc.py | 1 - Lib/bsddb/test/test_pickle.py | 2 +- Lib/bsddb/test/test_queue.py | 2 +- Lib/bsddb/test/test_recno.py | 1 - Lib/bsddb/test/test_sequence.py | 3 --- Lib/bsddb/test/test_thread.py | 1 - Lib/compiler/transformer.py | 1 - Lib/ctypes/test/__init__.py | 2 +- Lib/ctypes/test/test_checkretval.py | 1 - Lib/ctypes/test/test_find.py | 2 +- Lib/ctypes/test/test_libc.py | 1 - Lib/ctypes/test/test_loading.py | 2 +- Lib/ctypes/test/test_numbers.py | 2 +- Lib/curses/wrapper.py | 2 +- Lib/distutils/bcppcompiler.py | 2 +- Lib/distutils/command/bdist.py | 2 +- Lib/distutils/command/bdist_dumb.py | 2 +- Lib/distutils/command/bdist_msi.py | 2 +- Lib/distutils/command/bdist_rpm.py | 1 - Lib/distutils/command/build_py.py | 2 +- Lib/distutils/command/build_scripts.py | 2 +- Lib/distutils/command/install.py | 1 - Lib/distutils/command/install_headers.py | 1 - Lib/distutils/command/install_lib.py | 2 +- Lib/distutils/command/register.py | 2 +- Lib/distutils/command/sdist.py | 2 +- Lib/distutils/filelist.py | 1 - Lib/distutils/tests/test_dist.py | 2 -- Lib/distutils/tests/test_sysconfig.py | 1 - Lib/distutils/unixccompiler.py | 1 - Lib/email/base64mime.py | 1 - Lib/email/utils.py | 1 - Lib/hotshot/log.py | 1 - Lib/hotshot/stones.py | 1 - Lib/httplib.py | 1 - Lib/idlelib/MultiCall.py | 1 - Lib/idlelib/RemoteDebugger.py | 1 - Lib/idlelib/TreeWidget.py | 1 - Lib/idlelib/UndoDelegator.py | 1 - Lib/idlelib/configDialog.py | 2 +- Lib/idlelib/keybindingDialog.py | 2 +- Lib/idlelib/run.py | 1 - Lib/lib-tk/tkSimpleDialog.py | 1 - Lib/logging/handlers.py | 2 +- Lib/ntpath.py | 2 +- Lib/plat-mac/MiniAEFrame.py | 1 - Lib/plat-mac/aepack.py | 4 ---- Lib/plat-mac/bgenlocations.py | 2 +- Lib/plat-mac/macostools.py | 2 -- Lib/plat-riscos/rourl2path.py | 1 - Lib/sqlite3/test/hooks.py | 2 +- Lib/ssl.py | 2 +- Lib/test/fork_wait.py | 1 - Lib/test/list_tests.py | 1 - Lib/test/seq_tests.py | 1 - Lib/test/test_MimeWriter.py | 2 +- Lib/test/test___all__.py | 2 +- Lib/test/test_abc.py | 1 - Lib/test/test_applesingle.py | 1 - Lib/test/test_array.py | 2 +- Lib/test/test_bsddb185.py | 2 +- Lib/test/test_class.py | 1 - Lib/test/test_cmd.py | 3 +-- Lib/test/test_coercion.py | 1 - Lib/test/test_compare.py | 1 - Lib/test/test_compiler.py | 3 ++- Lib/test/test_copy.py | 1 - Lib/test/test_cpickle.py | 1 - Lib/test/test_datetime.py | 1 - Lib/test/test_dbm.py | 1 - Lib/test/test_deque.py | 1 - Lib/test/test_dict.py | 2 +- Lib/test/test_dis.py | 2 +- Lib/test/test_doctest.py | 2 +- Lib/test/test_dummy_threading.py | 1 - Lib/test/test_email.py | 1 - Lib/test/test_email_renamed.py | 1 - Lib/test/test_eof.py | 1 - Lib/test/test_extcall.py | 2 +- Lib/test/test_fileinput.py | 2 +- Lib/test/test_fractions.py | 2 +- Lib/test/test_getargs2.py | 3 +-- Lib/test/test_gzip.py | 2 +- Lib/test/test_htmlparser.py | 1 - Lib/test/test_httplib.py | 1 - Lib/test/test_imgfile.py | 2 +- Lib/test/test_imp.py | 1 - Lib/test/test_index.py | 1 - Lib/test/test_linuxaudiodev.py | 4 ---- Lib/test/test_list.py | 1 - Lib/test/test_logging.py | 4 ++-- Lib/test/test_minidom.py | 1 - Lib/test/test_module.py | 2 +- Lib/test/test_modulefinder.py | 2 +- Lib/test/test_multibytecodec_support.py | 2 +- Lib/test/test_optparse.py | 1 - Lib/test/test_ossaudiodev.py | 5 +---- Lib/test/test_pickle.py | 1 - Lib/test/test_pkg.py | 1 - Lib/test/test_plistlib.py | 1 - Lib/test/test_poll.py | 2 +- Lib/test/test_posix.py | 1 - Lib/test/test_pyclbr.py | 2 +- Lib/test/test_quopri.py | 2 +- Lib/test/test_resource.py | 1 - Lib/test/test_rfc822.py | 1 - Lib/test/test_scriptpackages.py | 3 --- Lib/test/test_sgmllib.py | 3 +-- Lib/test/test_shlex.py | 1 - Lib/test/test_site.py | 3 +-- Lib/test/test_socketserver.py | 1 - Lib/test/test_sqlite.py | 1 - Lib/test/test_str.py | 1 - Lib/test/test_strftime.py | 2 +- Lib/test/test_sunaudiodev.py | 2 +- Lib/test/test_support.py | 1 - Lib/test/test_tuple.py | 1 - Lib/test/test_unicode.py | 2 +- Lib/test/test_unpack.py | 1 - Lib/test/test_urllib.py | 4 ---- Lib/test/test_urllib2.py | 6 +++--- Lib/test/test_urllib2_localnet.py | 1 - Lib/test/test_userdict.py | 1 - Lib/test/test_userlist.py | 1 - Lib/test/test_userstring.py | 1 - Lib/test/test_uu.py | 1 - Lib/test/test_whichdb.py | 1 - Lib/test/test_xml_etree.py | 3 ++- Lib/test/test_xml_etree_c.py | 3 ++- Lib/test/test_xpickle.py | 1 - Lib/test/test_zipfile64.py | 1 - Mac/Demo/PICTbrowse/ICONbrowse.py | 2 -- Mac/Demo/PICTbrowse/PICTbrowse.py | 1 - Mac/Demo/PICTbrowse/PICTbrowse2.py | 1 - Mac/Demo/PICTbrowse/cicnbrowse.py | 2 -- Mac/Demo/PICTbrowse/oldPICTbrowse.py | 1 - Mac/Demo/example1/dnslookup-1.py | 1 - Mac/Demo/example2/dnslookup-2.py | 1 - Mac/Demo/imgbrowse/imgbrowse.py | 2 -- Mac/Demo/imgbrowse/mac_image.py | 1 - Mac/Demo/sound/morse.py | 2 +- Mac/Modules/ae/aescan.py | 2 -- Mac/Modules/ah/ahscan.py | 1 - Mac/Modules/app/appscan.py | 1 - Mac/Modules/carbonevt/CarbonEvtscan.py | 2 -- Mac/Modules/cf/cfscan.py | 1 - Mac/Modules/cg/cgscan.py | 1 - Mac/Modules/cm/cmscan.py | 1 - Mac/Modules/ctl/ctlscan.py | 1 - Mac/Modules/dlg/dlgscan.py | 1 - Mac/Modules/drag/dragscan.py | 1 - Mac/Modules/evt/evtscan.py | 1 - Mac/Modules/file/filescan.py | 1 - Mac/Modules/fm/fmscan.py | 1 - Mac/Modules/folder/folderscan.py | 1 - Mac/Modules/help/helpscan.py | 1 - Mac/Modules/ibcarbon/IBCarbonscan.py | 2 -- Mac/Modules/icn/icnscan.py | 1 - Mac/Modules/launch/launchscan.py | 1 - Mac/Modules/list/listscan.py | 1 - Mac/Modules/menu/menuscan.py | 1 - Mac/Modules/mlte/mltescan.py | 1 - Mac/Modules/osa/osascan.py | 1 - Mac/Modules/qd/qdscan.py | 1 - Mac/Modules/qdoffs/qdoffsscan.py | 1 - Mac/Modules/qt/qtscan.py | 1 - Mac/Modules/res/resscan.py | 2 -- Mac/Modules/scrap/scrapscan.py | 1 - Mac/Modules/snd/sndscan.py | 1 - Mac/Modules/te/tescan.py | 1 - Mac/Modules/win/winscan.py | 1 - Misc/BeOS-setup.py | 2 +- PC/VS8.0/build_tkinter.py | 1 - PCbuild/build_tkinter.py | 1 - Parser/asdl_c.py | 2 +- Parser/spark.py | 1 - Tools/compiler/astgen.py | 1 - Tools/compiler/dumppyc.py | 1 - Tools/faqwiz/faqw.py | 2 +- Tools/modulator/Tkextra.py | 1 - Tools/pybench/systimes.py | 2 +- Tools/pynche/ChipViewer.py | 1 - Tools/pynche/TypeinViewer.py | 2 -- Tools/scripts/logmerge.py | 2 +- Tools/scripts/nm2def.py | 2 +- Tools/scripts/pindent.py | 1 - Tools/scripts/pysource.py | 2 +- Tools/scripts/xxci.py | 1 - Tools/ssl/get-remote-certificate.py | 2 +- Tools/unicode/gencodec.py | 2 +- Tools/webchecker/wcgui.py | 1 - Tools/webchecker/wsgui.py | 2 -- 203 files changed, 77 insertions(+), 243 deletions(-) diff --git a/Lib/SimpleHTTPServer.py b/Lib/SimpleHTTPServer.py index 249e237fb7..7b6e8679af 100644 --- a/Lib/SimpleHTTPServer.py +++ b/Lib/SimpleHTTPServer.py @@ -14,7 +14,6 @@ import os import posixpath import BaseHTTPServer import urllib -import urlparse import cgi import shutil import mimetypes diff --git a/Lib/bsddb/test/test_basics.py b/Lib/bsddb/test/test_basics.py index c027ada74a..6d0fff15e4 100644 --- a/Lib/bsddb/test/test_basics.py +++ b/Lib/bsddb/test/test_basics.py @@ -4,7 +4,6 @@ various DB flags, etc. """ import os -import sys import errno import shutil import string diff --git a/Lib/bsddb/test/test_compat.py b/Lib/bsddb/test/test_compat.py index b108db4c6a..bc165cfbef 100644 --- a/Lib/bsddb/test/test_compat.py +++ b/Lib/bsddb/test/test_compat.py @@ -3,7 +3,7 @@ Test cases adapted from the test_bsddb.py module in Python's regression test suite. """ -import sys, os, string +import os, string import unittest import tempfile diff --git a/Lib/bsddb/test/test_cursor_pget_bug.py b/Lib/bsddb/test/test_cursor_pget_bug.py index 2f72b1155b..2e83a6cb1c 100644 --- a/Lib/bsddb/test/test_cursor_pget_bug.py +++ b/Lib/bsddb/test/test_cursor_pget_bug.py @@ -1,6 +1,6 @@ import unittest import tempfile -import sys, os, glob +import os, glob try: # For Pythons w/distutils pybsddb diff --git a/Lib/bsddb/test/test_dbobj.py b/Lib/bsddb/test/test_dbobj.py index 6086d77f72..dd9909d6d2 100644 --- a/Lib/bsddb/test/test_dbobj.py +++ b/Lib/bsddb/test/test_dbobj.py @@ -1,5 +1,5 @@ -import sys, os, string +import os, string import unittest import glob import tempfile diff --git a/Lib/bsddb/test/test_dbshelve.py b/Lib/bsddb/test/test_dbshelve.py index ddc05d5d4d..bd399a431a 100644 --- a/Lib/bsddb/test/test_dbshelve.py +++ b/Lib/bsddb/test/test_dbshelve.py @@ -2,9 +2,8 @@ TestCases for checking dbShelve objects. """ -import sys, os, string +import os, string import tempfile, random -from pprint import pprint from types import * import unittest diff --git a/Lib/bsddb/test/test_dbtables.py b/Lib/bsddb/test/test_dbtables.py index 3a401e3682..0c9cf5fffa 100644 --- a/Lib/bsddb/test/test_dbtables.py +++ b/Lib/bsddb/test/test_dbtables.py @@ -20,7 +20,7 @@ # # $Id$ -import sys, os, re +import os, re import tempfile import shutil try: diff --git a/Lib/bsddb/test/test_env_close.py b/Lib/bsddb/test/test_env_close.py index 5738febe0e..efc3460f79 100644 --- a/Lib/bsddb/test/test_env_close.py +++ b/Lib/bsddb/test/test_env_close.py @@ -3,7 +3,6 @@ is closed before its DB objects. """ import os -import sys import tempfile import glob import unittest diff --git a/Lib/bsddb/test/test_get_none.py b/Lib/bsddb/test/test_get_none.py index 5f09cecc6a..d6454cc736 100644 --- a/Lib/bsddb/test/test_get_none.py +++ b/Lib/bsddb/test/test_get_none.py @@ -2,9 +2,8 @@ TestCases for checking set_get_returns_none. """ -import sys, os, string +import os, string import tempfile -from pprint import pprint import unittest try: diff --git a/Lib/bsddb/test/test_join.py b/Lib/bsddb/test/test_join.py index 731f33a420..26c29124a7 100644 --- a/Lib/bsddb/test/test_join.py +++ b/Lib/bsddb/test/test_join.py @@ -1,10 +1,8 @@ """TestCases for using the DB.join and DBCursor.join_item methods. """ -import sys, os, string +import os import tempfile -import time -from pprint import pprint try: from threading import Thread, currentThread diff --git a/Lib/bsddb/test/test_lock.py b/Lib/bsddb/test/test_lock.py index e0d831f762..18469a19c2 100644 --- a/Lib/bsddb/test/test_lock.py +++ b/Lib/bsddb/test/test_lock.py @@ -2,10 +2,7 @@ TestCases for testing the locking sub-system. """ -import os -from pprint import pprint import shutil -import sys import tempfile import time diff --git a/Lib/bsddb/test/test_misc.py b/Lib/bsddb/test/test_misc.py index ef9c0aa8b6..3d566f10a9 100644 --- a/Lib/bsddb/test/test_misc.py +++ b/Lib/bsddb/test/test_misc.py @@ -2,7 +2,6 @@ """ import os -import sys import unittest import tempfile diff --git a/Lib/bsddb/test/test_pickle.py b/Lib/bsddb/test/test_pickle.py index ef84a4097f..b87cc689ec 100644 --- a/Lib/bsddb/test/test_pickle.py +++ b/Lib/bsddb/test/test_pickle.py @@ -1,5 +1,5 @@ -import sys, os, string +import os import pickle try: import cPickle diff --git a/Lib/bsddb/test/test_queue.py b/Lib/bsddb/test/test_queue.py index 95cf20d0d2..1acf35a91f 100644 --- a/Lib/bsddb/test/test_queue.py +++ b/Lib/bsddb/test/test_queue.py @@ -2,7 +2,7 @@ TestCases for exercising a Queue DB. """ -import sys, os, string +import os, string import tempfile from pprint import pprint import unittest diff --git a/Lib/bsddb/test/test_recno.py b/Lib/bsddb/test/test_recno.py index 4b36a40a02..9630db19d0 100644 --- a/Lib/bsddb/test/test_recno.py +++ b/Lib/bsddb/test/test_recno.py @@ -2,7 +2,6 @@ """ import os -import sys import errno import tempfile from pprint import pprint diff --git a/Lib/bsddb/test/test_sequence.py b/Lib/bsddb/test/test_sequence.py index 239e8ee13f..d7029e5cff 100644 --- a/Lib/bsddb/test/test_sequence.py +++ b/Lib/bsddb/test/test_sequence.py @@ -1,6 +1,5 @@ import unittest import os -import sys import tempfile import glob @@ -10,8 +9,6 @@ try: except ImportError: from bsddb import db -from test_all import verbose - class DBSequenceTest(unittest.TestCase): def setUp(self): diff --git a/Lib/bsddb/test/test_thread.py b/Lib/bsddb/test/test_thread.py index 9c87db4abe..d14f6da1fa 100644 --- a/Lib/bsddb/test/test_thread.py +++ b/Lib/bsddb/test/test_thread.py @@ -7,7 +7,6 @@ import time import errno import shutil import tempfile -from pprint import pprint from random import random try: diff --git a/Lib/compiler/transformer.py b/Lib/compiler/transformer.py index 77ac7764bf..56cc1efe71 100644 --- a/Lib/compiler/transformer.py +++ b/Lib/compiler/transformer.py @@ -29,7 +29,6 @@ from compiler.ast import * import parser import symbol import token -import sys class WalkerError(StandardError): pass diff --git a/Lib/ctypes/test/__init__.py b/Lib/ctypes/test/__init__.py index 2b745c206e..339ec8b408 100644 --- a/Lib/ctypes/test/__init__.py +++ b/Lib/ctypes/test/__init__.py @@ -1,4 +1,4 @@ -import glob, os, sys, unittest, getopt, time +import os, sys, unittest, getopt, time use_resources = [] diff --git a/Lib/ctypes/test/test_checkretval.py b/Lib/ctypes/test/test_checkretval.py index 28be6c619f..d15bd2efe6 100644 --- a/Lib/ctypes/test/test_checkretval.py +++ b/Lib/ctypes/test/test_checkretval.py @@ -1,5 +1,4 @@ import unittest -import sys from ctypes import * diff --git a/Lib/ctypes/test/test_find.py b/Lib/ctypes/test/test_find.py index 0cfe82e1f8..ed1297dc15 100644 --- a/Lib/ctypes/test/test_find.py +++ b/Lib/ctypes/test/test_find.py @@ -1,5 +1,5 @@ import unittest -import os, sys +import sys from ctypes import * from ctypes.util import find_library from ctypes.test import is_resource_enabled diff --git a/Lib/ctypes/test/test_libc.py b/Lib/ctypes/test/test_libc.py index c39f3507c0..8d59f903fc 100644 --- a/Lib/ctypes/test/test_libc.py +++ b/Lib/ctypes/test/test_libc.py @@ -1,4 +1,3 @@ -import sys, os import unittest from ctypes import * diff --git a/Lib/ctypes/test/test_loading.py b/Lib/ctypes/test/test_loading.py index 291fccac14..4b950291d4 100644 --- a/Lib/ctypes/test/test_loading.py +++ b/Lib/ctypes/test/test_loading.py @@ -1,6 +1,6 @@ from ctypes import * import sys, unittest -import os, StringIO +import os from ctypes.util import find_library from ctypes.test import is_resource_enabled diff --git a/Lib/ctypes/test/test_numbers.py b/Lib/ctypes/test/test_numbers.py index 5845741327..dfd84eeac0 100644 --- a/Lib/ctypes/test/test_numbers.py +++ b/Lib/ctypes/test/test_numbers.py @@ -1,6 +1,6 @@ from ctypes import * import unittest -import sys, struct +import struct def valid_ranges(*types): # given a sequence of numeric types, collect their _type_ diff --git a/Lib/curses/wrapper.py b/Lib/curses/wrapper.py index 53352041e9..9f1d86785d 100644 --- a/Lib/curses/wrapper.py +++ b/Lib/curses/wrapper.py @@ -7,7 +7,7 @@ to a sane state so you can read the resulting traceback. """ -import sys, curses +import curses def wrapper(func, *args, **kwds): """Wrapper function that initializes curses and calls another function, diff --git a/Lib/distutils/bcppcompiler.py b/Lib/distutils/bcppcompiler.py index ca524a5b88..d4fc53366f 100644 --- a/Lib/distutils/bcppcompiler.py +++ b/Lib/distutils/bcppcompiler.py @@ -16,7 +16,7 @@ for the Borland C++ compiler. __revision__ = "$Id$" -import sys, os +import os from distutils.errors import \ DistutilsExecError, DistutilsPlatformError, \ CompileError, LibError, LinkError, UnknownFileError diff --git a/Lib/distutils/command/bdist.py b/Lib/distutils/command/bdist.py index 23c25a55a8..d6897d2d09 100644 --- a/Lib/distutils/command/bdist.py +++ b/Lib/distutils/command/bdist.py @@ -7,7 +7,7 @@ distribution).""" __revision__ = "$Id$" -import os, string +import os from types import * from distutils.core import Command from distutils.errors import * diff --git a/Lib/distutils/command/bdist_dumb.py b/Lib/distutils/command/bdist_dumb.py index ccba00955a..f740c468e7 100644 --- a/Lib/distutils/command/bdist_dumb.py +++ b/Lib/distutils/command/bdist_dumb.py @@ -11,7 +11,7 @@ __revision__ = "$Id$" import os from distutils.core import Command from distutils.util import get_platform -from distutils.dir_util import create_tree, remove_tree, ensure_relative +from distutils.dir_util import remove_tree, ensure_relative from distutils.errors import * from distutils.sysconfig import get_python_version from distutils import log diff --git a/Lib/distutils/command/bdist_msi.py b/Lib/distutils/command/bdist_msi.py index a1c0df4bc5..a4014525b7 100644 --- a/Lib/distutils/command/bdist_msi.py +++ b/Lib/distutils/command/bdist_msi.py @@ -7,7 +7,7 @@ Implements the bdist_msi command. """ -import sys, os, string +import sys, os from distutils.core import Command from distutils.util import get_platform from distutils.dir_util import remove_tree diff --git a/Lib/distutils/command/bdist_rpm.py b/Lib/distutils/command/bdist_rpm.py index 6f0e0d881c..9aa7030049 100644 --- a/Lib/distutils/command/bdist_rpm.py +++ b/Lib/distutils/command/bdist_rpm.py @@ -8,7 +8,6 @@ distributions).""" __revision__ = "$Id$" import sys, os, string -import glob from types import * from distutils.core import Command from distutils.debug import DEBUG diff --git a/Lib/distutils/command/build_py.py b/Lib/distutils/command/build_py.py index b9f39bae79..be6d2c5b4d 100644 --- a/Lib/distutils/command/build_py.py +++ b/Lib/distutils/command/build_py.py @@ -6,7 +6,7 @@ Implements the Distutils 'build_py' command.""" __revision__ = "$Id$" -import sys, string, os +import string, os from types import * from glob import glob diff --git a/Lib/distutils/command/build_scripts.py b/Lib/distutils/command/build_scripts.py index 6af363b36d..104be0b349 100644 --- a/Lib/distutils/command/build_scripts.py +++ b/Lib/distutils/command/build_scripts.py @@ -6,7 +6,7 @@ Implements the Distutils 'build_scripts' command.""" __revision__ = "$Id$" -import sys, os, re +import os, re from stat import ST_MODE from distutils import sysconfig from distutils.core import Command diff --git a/Lib/distutils/command/install.py b/Lib/distutils/command/install.py index c62121023d..0d39b91cc3 100644 --- a/Lib/distutils/command/install.py +++ b/Lib/distutils/command/install.py @@ -17,7 +17,6 @@ from distutils.errors import DistutilsPlatformError from distutils.file_util import write_file from distutils.util import convert_path, subst_vars, change_root from distutils.errors import DistutilsOptionError -from glob import glob if sys.version < "2.2": WINDOWS_SCHEME = { diff --git a/Lib/distutils/command/install_headers.py b/Lib/distutils/command/install_headers.py index 2bd1b04367..4895240a4c 100644 --- a/Lib/distutils/command/install_headers.py +++ b/Lib/distutils/command/install_headers.py @@ -7,7 +7,6 @@ files to the Python include directory.""" __revision__ = "$Id$" -import os from distutils.core import Command diff --git a/Lib/distutils/command/install_lib.py b/Lib/distutils/command/install_lib.py index 08ff543449..81107a85cb 100644 --- a/Lib/distutils/command/install_lib.py +++ b/Lib/distutils/command/install_lib.py @@ -2,7 +2,7 @@ __revision__ = "$Id$" -import sys, os, string +import os from types import IntType from distutils.core import Command from distutils.errors import DistutilsOptionError diff --git a/Lib/distutils/command/register.py b/Lib/distutils/command/register.py index d1a9100de4..5c588effd3 100644 --- a/Lib/distutils/command/register.py +++ b/Lib/distutils/command/register.py @@ -7,7 +7,7 @@ Implements the Distutils 'register' command (register with the repository). __revision__ = "$Id$" -import sys, os, string, urllib2, getpass, urlparse +import os, string, urllib2, getpass, urlparse import StringIO, ConfigParser from distutils.core import Command diff --git a/Lib/distutils/command/sdist.py b/Lib/distutils/command/sdist.py index a06b1953b4..9b37f78982 100644 --- a/Lib/distutils/command/sdist.py +++ b/Lib/distutils/command/sdist.py @@ -6,7 +6,7 @@ Implements the Distutils 'sdist' command (create a source distribution).""" __revision__ = "$Id$" -import sys, os, string +import os, string from types import * from glob import glob from distutils.core import Command diff --git a/Lib/distutils/filelist.py b/Lib/distutils/filelist.py index 43f9aaaf5b..6d27cce64f 100644 --- a/Lib/distutils/filelist.py +++ b/Lib/distutils/filelist.py @@ -11,7 +11,6 @@ __revision__ = "$Id$" import os, string, re import fnmatch from types import * -from glob import glob from distutils.util import convert_path from distutils.errors import DistutilsTemplateError, DistutilsInternalError from distutils import log diff --git a/Lib/distutils/tests/test_dist.py b/Lib/distutils/tests/test_dist.py index 4d2a7cdf1a..5ae79332c0 100644 --- a/Lib/distutils/tests/test_dist.py +++ b/Lib/distutils/tests/test_dist.py @@ -3,10 +3,8 @@ import distutils.cmd import distutils.dist import os -import shutil import StringIO import sys -import tempfile import unittest from test.test_support import TESTFN diff --git a/Lib/distutils/tests/test_sysconfig.py b/Lib/distutils/tests/test_sysconfig.py index 770b7c376f..d56f7e9bc5 100644 --- a/Lib/distutils/tests/test_sysconfig.py +++ b/Lib/distutils/tests/test_sysconfig.py @@ -2,7 +2,6 @@ from distutils import sysconfig import os -import sys import unittest from test.test_support import TESTFN diff --git a/Lib/distutils/unixccompiler.py b/Lib/distutils/unixccompiler.py index 75e8a5316e..dc759ee8f5 100644 --- a/Lib/distutils/unixccompiler.py +++ b/Lib/distutils/unixccompiler.py @@ -17,7 +17,6 @@ __revision__ = "$Id$" import os, sys from types import StringType, NoneType -from copy import copy from distutils import sysconfig from distutils.dep_util import newer diff --git a/Lib/email/base64mime.py b/Lib/email/base64mime.py index 0129d9d4e6..8e76e433c5 100644 --- a/Lib/email/base64mime.py +++ b/Lib/email/base64mime.py @@ -35,7 +35,6 @@ __all__ = [ 'header_encode', ] -import re from binascii import b2a_base64, a2b_base64 from email.utils import fix_eols diff --git a/Lib/email/utils.py b/Lib/email/utils.py index ee952d392e..50010e69b0 100644 --- a/Lib/email/utils.py +++ b/Lib/email/utils.py @@ -27,7 +27,6 @@ import random import socket import urllib import warnings -from cStringIO import StringIO from email._parseaddr import quote from email._parseaddr import AddressList as _AddressList diff --git a/Lib/hotshot/log.py b/Lib/hotshot/log.py index 7d6d91d447..99d0729494 100644 --- a/Lib/hotshot/log.py +++ b/Lib/hotshot/log.py @@ -2,7 +2,6 @@ import _hotshot import os.path import parser import symbol -import sys from _hotshot import \ WHAT_ENTER, \ diff --git a/Lib/hotshot/stones.py b/Lib/hotshot/stones.py index cd4c51d483..fb88d581d3 100644 --- a/Lib/hotshot/stones.py +++ b/Lib/hotshot/stones.py @@ -1,7 +1,6 @@ import errno import hotshot import hotshot.stats -import os import sys import test.pystone diff --git a/Lib/httplib.py b/Lib/httplib.py index 6d27d24466..c7d8e781df 100644 --- a/Lib/httplib.py +++ b/Lib/httplib.py @@ -66,7 +66,6 @@ Req-started-unread-response _CS_REQ_STARTED Req-sent-unread-response _CS_REQ_SENT """ -import errno import mimetools import socket from urlparse import urlsplit diff --git a/Lib/idlelib/MultiCall.py b/Lib/idlelib/MultiCall.py index 547df13ee3..51de6390aa 100644 --- a/Lib/idlelib/MultiCall.py +++ b/Lib/idlelib/MultiCall.py @@ -30,7 +30,6 @@ Each function will be called at most once for each event. """ import sys -import os import string import re import Tkinter diff --git a/Lib/idlelib/RemoteDebugger.py b/Lib/idlelib/RemoteDebugger.py index 74085c36f5..fa234d17c1 100644 --- a/Lib/idlelib/RemoteDebugger.py +++ b/Lib/idlelib/RemoteDebugger.py @@ -20,7 +20,6 @@ barrier, in particular frame and traceback objects. """ -import sys import types import rpc import Debugger diff --git a/Lib/idlelib/TreeWidget.py b/Lib/idlelib/TreeWidget.py index c5c171fb83..5299e0e951 100644 --- a/Lib/idlelib/TreeWidget.py +++ b/Lib/idlelib/TreeWidget.py @@ -15,7 +15,6 @@ # - optimize tree redraw after expand of subnode import os -import sys from Tkinter import * import imp diff --git a/Lib/idlelib/UndoDelegator.py b/Lib/idlelib/UndoDelegator.py index 182a1170e8..5896bd5d1b 100644 --- a/Lib/idlelib/UndoDelegator.py +++ b/Lib/idlelib/UndoDelegator.py @@ -1,4 +1,3 @@ -import sys import string from Tkinter import * from Delegator import Delegator diff --git a/Lib/idlelib/configDialog.py b/Lib/idlelib/configDialog.py index 010ab2c1aa..acab053486 100644 --- a/Lib/idlelib/configDialog.py +++ b/Lib/idlelib/configDialog.py @@ -11,7 +11,7 @@ Refer to comments in EditorWindow autoindent code for details. """ from Tkinter import * import tkMessageBox, tkColorChooser, tkFont -import string, copy +import string from configHandler import idleConf from dynOptionMenuWidget import DynOptionMenu diff --git a/Lib/idlelib/keybindingDialog.py b/Lib/idlelib/keybindingDialog.py index aff9cac587..1ce7ff4686 100644 --- a/Lib/idlelib/keybindingDialog.py +++ b/Lib/idlelib/keybindingDialog.py @@ -3,7 +3,7 @@ Dialog for building Tkinter accelerator key bindings """ from Tkinter import * import tkMessageBox -import string, os +import string class GetKeysDialog(Toplevel): def __init__(self,parent,title,action,currentKeySequences): diff --git a/Lib/idlelib/run.py b/Lib/idlelib/run.py index 6e919827b9..7827c740e6 100644 --- a/Lib/idlelib/run.py +++ b/Lib/idlelib/run.py @@ -1,5 +1,4 @@ import sys -import os import linecache import time import socket diff --git a/Lib/lib-tk/tkSimpleDialog.py b/Lib/lib-tk/tkSimpleDialog.py index 03475f4060..6948a49325 100644 --- a/Lib/lib-tk/tkSimpleDialog.py +++ b/Lib/lib-tk/tkSimpleDialog.py @@ -26,7 +26,6 @@ askstring -- get a string from the user ''' from Tkinter import * -import os class Dialog(Toplevel): diff --git a/Lib/logging/handlers.py b/Lib/logging/handlers.py index e8081d6c1f..a974e83ce6 100644 --- a/Lib/logging/handlers.py +++ b/Lib/logging/handlers.py @@ -27,7 +27,7 @@ Copyright (C) 2001-2007 Vinay Sajip. All Rights Reserved. To use, simply 'import logging' and log away! """ -import sys, logging, socket, types, os, string, cPickle, struct, time, glob +import logging, socket, types, os, string, cPickle, struct, time, glob from stat import ST_DEV, ST_INO try: diff --git a/Lib/ntpath.py b/Lib/ntpath.py index c4a4ac5f70..59f1402288 100644 --- a/Lib/ntpath.py +++ b/Lib/ntpath.py @@ -6,8 +6,8 @@ module as os.path. """ import os -import stat import sys +import stat import genericpath from genericpath import * diff --git a/Lib/plat-mac/MiniAEFrame.py b/Lib/plat-mac/MiniAEFrame.py index 98247cbf34..6a08dc942d 100644 --- a/Lib/plat-mac/MiniAEFrame.py +++ b/Lib/plat-mac/MiniAEFrame.py @@ -6,7 +6,6 @@ There are two classes: only suitable for the simplest of AppleEvent servers. """ -import sys import traceback import MacOS from Carbon import AE diff --git a/Lib/plat-mac/aepack.py b/Lib/plat-mac/aepack.py index 529a0a4ed8..9ad9c4401e 100644 --- a/Lib/plat-mac/aepack.py +++ b/Lib/plat-mac/aepack.py @@ -13,18 +13,14 @@ coerce(x, wanted_sample) coerces a python object to another python object # import struct -import string import types -from string import strip from types import * from Carbon import AE from Carbon.AppleEvents import * import MacOS import Carbon.File -import StringIO import aetypes from aetypes import mkenum, ObjectSpecifier -import os # These ones seem to be missing from AppleEvents # (they're in AERegistry.h) diff --git a/Lib/plat-mac/bgenlocations.py b/Lib/plat-mac/bgenlocations.py index e7fa354075..271eb3e10a 100644 --- a/Lib/plat-mac/bgenlocations.py +++ b/Lib/plat-mac/bgenlocations.py @@ -5,7 +5,7 @@ # but mac-style for MacPython, whether running on OS9 or OSX. # -import sys, os +import os Error = "bgenlocations.Error" # diff --git a/Lib/plat-mac/macostools.py b/Lib/plat-mac/macostools.py index fc4861e691..217f9e8739 100644 --- a/Lib/plat-mac/macostools.py +++ b/Lib/plat-mac/macostools.py @@ -7,9 +7,7 @@ copy(src, dst) - Full copy of 'src' to 'dst' from Carbon import Res from Carbon import File, Files import os -import sys import MacOS -import time try: openrf = MacOS.openrf except AttributeError: diff --git a/Lib/plat-riscos/rourl2path.py b/Lib/plat-riscos/rourl2path.py index 7a8badf446..5d5386e65c 100644 --- a/Lib/plat-riscos/rourl2path.py +++ b/Lib/plat-riscos/rourl2path.py @@ -4,7 +4,6 @@ Do not import directly, use urllib instead.""" import string import urllib -import os __all__ = ["url2pathname","pathname2url"] diff --git a/Lib/sqlite3/test/hooks.py b/Lib/sqlite3/test/hooks.py index 761bdaa6b7..cb0a6216fd 100644 --- a/Lib/sqlite3/test/hooks.py +++ b/Lib/sqlite3/test/hooks.py @@ -21,7 +21,7 @@ # misrepresented as being the original software. # 3. This notice may not be removed or altered from any source distribution. -import os, unittest +import unittest import sqlite3 as sqlite class CollationTests(unittest.TestCase): diff --git a/Lib/ssl.py b/Lib/ssl.py index 92881440a3..24502e44e0 100644 --- a/Lib/ssl.py +++ b/Lib/ssl.py @@ -55,7 +55,7 @@ PROTOCOL_SSLv23 PROTOCOL_TLSv1 """ -import os, sys, textwrap +import textwrap import _ssl # if we can't import it, let the error propagate diff --git a/Lib/test/fork_wait.py b/Lib/test/fork_wait.py index 7eb55f6683..3c75de39d6 100644 --- a/Lib/test/fork_wait.py +++ b/Lib/test/fork_wait.py @@ -13,7 +13,6 @@ the same application, the present example should work just fine. DC """ import os, sys, time, thread, unittest -from test.test_support import TestSkipped LONGSLEEP = 2 SHORTSLEEP = 0.5 diff --git a/Lib/test/list_tests.py b/Lib/test/list_tests.py index 88bc49d6fd..b3f24d30a9 100644 --- a/Lib/test/list_tests.py +++ b/Lib/test/list_tests.py @@ -5,7 +5,6 @@ Tests common to list and UserList.UserList import sys import os -import unittest from test import test_support, seq_tests class CommonTest(seq_tests.CommonTest): diff --git a/Lib/test/seq_tests.py b/Lib/test/seq_tests.py index 2ea50945ed..d9b2d2966e 100644 --- a/Lib/test/seq_tests.py +++ b/Lib/test/seq_tests.py @@ -3,7 +3,6 @@ Tests common to tuple, list and UserList.UserList """ import unittest -from test import test_support import sys # Various iterables diff --git a/Lib/test/test_MimeWriter.py b/Lib/test/test_MimeWriter.py index 5a20bf226b..6a32cb6b62 100644 --- a/Lib/test/test_MimeWriter.py +++ b/Lib/test/test_MimeWriter.py @@ -7,7 +7,7 @@ This should generate Barry's example, modulo some quotes and newlines. """ -import unittest, sys, StringIO +import unittest, StringIO from test.test_support import run_unittest import warnings diff --git a/Lib/test/test___all__.py b/Lib/test/test___all__.py index 26ed012272..571e3912b2 100644 --- a/Lib/test/test___all__.py +++ b/Lib/test/test___all__.py @@ -1,5 +1,5 @@ import unittest -from test.test_support import verbose, run_unittest +from test.test_support import run_unittest import sys import warnings diff --git a/Lib/test/test_abc.py b/Lib/test/test_abc.py index ac5f7ee245..c53dceacbd 100644 --- a/Lib/test/test_abc.py +++ b/Lib/test/test_abc.py @@ -3,7 +3,6 @@ """Unit tests for abc.py.""" -import sys import unittest from test import test_support diff --git a/Lib/test/test_applesingle.py b/Lib/test/test_applesingle.py index d533f1abc0..e915028dca 100644 --- a/Lib/test/test_applesingle.py +++ b/Lib/test/test_applesingle.py @@ -5,7 +5,6 @@ import macostools import Carbon.File import MacOS import os -import sys from test import test_support import struct import applesingle diff --git a/Lib/test/test_array.py b/Lib/test/test_array.py index 0bb7e53706..a54594a450 100755 --- a/Lib/test/test_array.py +++ b/Lib/test/test_array.py @@ -6,7 +6,7 @@ import unittest from test import test_support from weakref import proxy -import array, cStringIO, math +import array, cStringIO from cPickle import loads, dumps class ArraySubclass(array.array): diff --git a/Lib/test/test_bsddb185.py b/Lib/test/test_bsddb185.py index df1ece09c9..51e1a7eb8d 100644 --- a/Lib/test/test_bsddb185.py +++ b/Lib/test/test_bsddb185.py @@ -4,7 +4,7 @@ The file 185test.db found in Lib/test/ is for testing purposes with this testing suite. """ -from test.test_support import verbose, run_unittest, findfile +from test.test_support import run_unittest, findfile import unittest import bsddb185 import anydbm diff --git a/Lib/test/test_class.py b/Lib/test/test_class.py index 9cf333187a..fc61d21a22 100644 --- a/Lib/test/test_class.py +++ b/Lib/test/test_class.py @@ -1,7 +1,6 @@ "Test the functionality of Python classes implementing operators." import unittest -import sys from test import test_support diff --git a/Lib/test/test_cmd.py b/Lib/test/test_cmd.py index 5aa1c40fa1..c08df0ba23 100644 --- a/Lib/test/test_cmd.py +++ b/Lib/test/test_cmd.py @@ -5,7 +5,6 @@ Original by Michael Schneider """ -from test import test_support import cmd import sys @@ -170,7 +169,7 @@ def test_main(verbose=None): from test import test_support, test_cmd test_support.run_doctest(test_cmd, verbose) -import trace, sys,re,StringIO +import trace, sys def test_coverage(coverdir): tracer=trace.Trace(ignoredirs=[sys.prefix, sys.exec_prefix,], trace=0, count=1) diff --git a/Lib/test/test_coercion.py b/Lib/test/test_coercion.py index d704e4b734..e3a7e43737 100644 --- a/Lib/test/test_coercion.py +++ b/Lib/test/test_coercion.py @@ -1,5 +1,4 @@ import copy -import sys import warnings import unittest from test.test_support import run_unittest, TestFailed diff --git a/Lib/test/test_compare.py b/Lib/test/test_compare.py index 2fde614dd4..13da80d2d4 100644 --- a/Lib/test/test_compare.py +++ b/Lib/test/test_compare.py @@ -1,4 +1,3 @@ -import sys import unittest from test import test_support diff --git a/Lib/test/test_compiler.py b/Lib/test/test_compiler.py index 606ed700df..7d5ec7c5b8 100644 --- a/Lib/test/test_compiler.py +++ b/Lib/test/test_compiler.py @@ -52,7 +52,8 @@ class CompilerTest(unittest.TestCase): compiler.compile(buf, basename, "exec") except Exception, e: args = list(e.args) - args[0] += "[in file %s]" % basename + args.append("in file %s]" % basename) + #args[0] += "[in file %s]" % basename e.args = tuple(args) raise diff --git a/Lib/test/test_copy.py b/Lib/test/test_copy.py index ff4c987eba..d2899bd4ea 100644 --- a/Lib/test/test_copy.py +++ b/Lib/test/test_copy.py @@ -1,6 +1,5 @@ """Unit tests for the copy module.""" -import sys import copy import copy_reg diff --git a/Lib/test/test_cpickle.py b/Lib/test/test_cpickle.py index 78beda773c..d6e703a7fa 100644 --- a/Lib/test/test_cpickle.py +++ b/Lib/test/test_cpickle.py @@ -1,5 +1,4 @@ import cPickle -import unittest from cStringIO import StringIO from test.pickletester import AbstractPickleTests, AbstractPickleModuleTests from test import test_support diff --git a/Lib/test/test_datetime.py b/Lib/test/test_datetime.py index cb639b41ea..ee104e45ed 100644 --- a/Lib/test/test_datetime.py +++ b/Lib/test/test_datetime.py @@ -4,7 +4,6 @@ See http://www.zope.org/Members/fdrake/DateTimeWiki/TestCases """ import os -import sys import pickle import cPickle import unittest diff --git a/Lib/test/test_dbm.py b/Lib/test/test_dbm.py index b93e72eb72..4da0932bfc 100755 --- a/Lib/test/test_dbm.py +++ b/Lib/test/test_dbm.py @@ -3,7 +3,6 @@ Roger E. Masse """ import os -import random import dbm from dbm import error from test.test_support import verbose, verify, TestSkipped, TESTFN diff --git a/Lib/test/test_deque.py b/Lib/test/test_deque.py index e0ca746cd0..b69110d88d 100644 --- a/Lib/test/test_deque.py +++ b/Lib/test/test_deque.py @@ -4,7 +4,6 @@ from test import test_support, seq_tests from weakref import proxy import copy import cPickle as pickle -from cStringIO import StringIO import random import os diff --git a/Lib/test/test_dict.py b/Lib/test/test_dict.py index 4ed76ea10b..7dd5f06868 100644 --- a/Lib/test/test_dict.py +++ b/Lib/test/test_dict.py @@ -1,7 +1,7 @@ import unittest from test import test_support -import sys, UserDict, cStringIO, random, string +import UserDict, random, string class DictTest(unittest.TestCase): diff --git a/Lib/test/test_dis.py b/Lib/test/test_dis.py index d0e1c7e8e4..fd508a94a2 100644 --- a/Lib/test/test_dis.py +++ b/Lib/test/test_dis.py @@ -1,6 +1,6 @@ # Minimal tests for dis module -from test.test_support import verbose, run_unittest +from test.test_support import run_unittest import unittest import sys import dis diff --git a/Lib/test/test_doctest.py b/Lib/test/test_doctest.py index 8c8786a12b..943fb82182 100644 --- a/Lib/test/test_doctest.py +++ b/Lib/test/test_doctest.py @@ -2418,7 +2418,7 @@ def test_main(): from test import test_doctest test_support.run_doctest(test_doctest, verbosity=True) -import trace, sys, re, StringIO +import trace, sys def test_coverage(coverdir): tracer = trace.Trace(ignoredirs=[sys.prefix, sys.exec_prefix,], trace=0, count=1) diff --git a/Lib/test/test_dummy_threading.py b/Lib/test/test_dummy_threading.py index 3724f1e5a4..dcb9729fe3 100644 --- a/Lib/test/test_dummy_threading.py +++ b/Lib/test/test_dummy_threading.py @@ -3,7 +3,6 @@ # Create a bunch of threads, let each do some work, wait until all are done from test.test_support import verbose -import random import dummy_threading as _threading import time diff --git a/Lib/test/test_email.py b/Lib/test/test_email.py index f609968167..cb4ee6083e 100644 --- a/Lib/test/test_email.py +++ b/Lib/test/test_email.py @@ -1,7 +1,6 @@ # Copyright (C) 2001,2002 Python Software Foundation # email package unit tests -import unittest # The specific tests now live in Lib/email/test from email.test.test_email import suite from test import test_support diff --git a/Lib/test/test_email_renamed.py b/Lib/test/test_email_renamed.py index 163e791d8a..2c814dfdec 100644 --- a/Lib/test/test_email_renamed.py +++ b/Lib/test/test_email_renamed.py @@ -1,7 +1,6 @@ # Copyright (C) 2001-2006 Python Software Foundation # email package unit tests -import unittest # The specific tests now live in Lib/email/test from email.test.test_email_renamed import suite from test import test_support diff --git a/Lib/test/test_eof.py b/Lib/test/test_eof.py index aae35182bd..4d4c03b9d7 100644 --- a/Lib/test/test_eof.py +++ b/Lib/test/test_eof.py @@ -1,7 +1,6 @@ #! /usr/bin/env python """test script for a few new invalid token catches""" -import os import unittest from test import test_support diff --git a/Lib/test/test_extcall.py b/Lib/test/test_extcall.py index 96d1bc184c..bdf8e03f86 100644 --- a/Lib/test/test_extcall.py +++ b/Lib/test/test_extcall.py @@ -1,4 +1,4 @@ -from test.test_support import verify, verbose, TestFailed, sortdict +from test.test_support import verify, TestFailed, sortdict from UserList import UserList from UserDict import UserDict diff --git a/Lib/test/test_fileinput.py b/Lib/test/test_fileinput.py index f6589b76ff..9fb3ea7f7a 100644 --- a/Lib/test/test_fileinput.py +++ b/Lib/test/test_fileinput.py @@ -6,7 +6,7 @@ Nick Mathewson import unittest from test.test_support import verbose, TESTFN, run_unittest from test.test_support import unlink as safe_unlink -import sys, os, re +import sys, re from StringIO import StringIO from fileinput import FileInput, hook_encoded diff --git a/Lib/test/test_fractions.py b/Lib/test/test_fractions.py index 654456adf6..743f0943a4 100644 --- a/Lib/test/test_fractions.py +++ b/Lib/test/test_fractions.py @@ -1,7 +1,7 @@ """Tests for Lib/fractions.py.""" from decimal import Decimal -from test.test_support import run_unittest, verbose +from test.test_support import run_unittest import math import operator import fractions diff --git a/Lib/test/test_getargs2.py b/Lib/test/test_getargs2.py index 90ca303eca..fa76fbc118 100644 --- a/Lib/test/test_getargs2.py +++ b/Lib/test/test_getargs2.py @@ -1,8 +1,7 @@ import unittest from test import test_support -import sys -import warnings, re +import warnings warnings.filterwarnings("ignore", category=DeprecationWarning, message=".*integer argument expected, got float", diff --git a/Lib/test/test_gzip.py b/Lib/test/test_gzip.py index 124a4692b1..1704a60dc8 100644 --- a/Lib/test/test_gzip.py +++ b/Lib/test/test_gzip.py @@ -4,7 +4,7 @@ import unittest from test import test_support -import sys, os +import os import gzip diff --git a/Lib/test/test_htmlparser.py b/Lib/test/test_htmlparser.py index 229bbeddf2..810af6c8cb 100755 --- a/Lib/test/test_htmlparser.py +++ b/Lib/test/test_htmlparser.py @@ -2,7 +2,6 @@ import HTMLParser import pprint -import sys import unittest from test import test_support diff --git a/Lib/test/test_httplib.py b/Lib/test/test_httplib.py index 6a20c6b81d..d312ae5fa9 100644 --- a/Lib/test/test_httplib.py +++ b/Lib/test/test_httplib.py @@ -1,6 +1,5 @@ import httplib import StringIO -import sys import socket from unittest import TestCase diff --git a/Lib/test/test_imgfile.py b/Lib/test/test_imgfile.py index bdfd796b1e..11311c4f43 100755 --- a/Lib/test/test_imgfile.py +++ b/Lib/test/test_imgfile.py @@ -6,7 +6,7 @@ from test.test_support import verbose, unlink, findfile -import imgfile, uu, os +import imgfile, uu def main(): diff --git a/Lib/test/test_imp.py b/Lib/test/test_imp.py index 62b14e071b..f597728b16 100644 --- a/Lib/test/test_imp.py +++ b/Lib/test/test_imp.py @@ -1,5 +1,4 @@ import imp -import thread import unittest from test import test_support diff --git a/Lib/test/test_index.py b/Lib/test/test_index.py index 323b37b754..75f2434273 100644 --- a/Lib/test/test_index.py +++ b/Lib/test/test_index.py @@ -1,7 +1,6 @@ import unittest from test import test_support import operator -import sys from sys import maxint maxsize = test_support.MAX_Py_ssize_t minsize = -maxsize-1 diff --git a/Lib/test/test_linuxaudiodev.py b/Lib/test/test_linuxaudiodev.py index 5d1d1ce137..303490bcdc 100644 --- a/Lib/test/test_linuxaudiodev.py +++ b/Lib/test/test_linuxaudiodev.py @@ -4,13 +4,9 @@ test_support.requires('audio') from test.test_support import findfile, TestSkipped, run_unittest import errno -import fcntl import linuxaudiodev -import os import sys -import select import sunaudio -import time import audioop import unittest diff --git a/Lib/test/test_list.py b/Lib/test/test_list.py index 34895290a6..37507fe8f4 100644 --- a/Lib/test/test_list.py +++ b/Lib/test/test_list.py @@ -1,4 +1,3 @@ -import unittest import sys from test import test_support, list_tests diff --git a/Lib/test/test_logging.py b/Lib/test/test_logging.py index 1ed6cb279e..5a96664c29 100644 --- a/Lib/test/test_logging.py +++ b/Lib/test/test_logging.py @@ -1858,8 +1858,8 @@ INF -> INFO: Finish up, it's closing time. Messages should bear numbers 0 throug """ import select -import os, sys, string, struct, types, cPickle, cStringIO -import socket, tempfile, threading, time +import os, sys, string, struct, cPickle, cStringIO +import socket, threading import logging, logging.handlers, logging.config, test.test_support diff --git a/Lib/test/test_minidom.py b/Lib/test/test_minidom.py index fcc4c8fec3..97bca2c8a7 100644 --- a/Lib/test/test_minidom.py +++ b/Lib/test/test_minidom.py @@ -3,7 +3,6 @@ import os import sys import pickle -import traceback from StringIO import StringIO from test.test_support import verbose, run_unittest, TestSkipped import unittest diff --git a/Lib/test/test_module.py b/Lib/test/test_module.py index cc8b1926b8..e0c7ec3b9f 100644 --- a/Lib/test/test_module.py +++ b/Lib/test/test_module.py @@ -1,6 +1,6 @@ # Test the module type import unittest -from test.test_support import verbose, run_unittest +from test.test_support import run_unittest import sys ModuleType = type(sys) diff --git a/Lib/test/test_modulefinder.py b/Lib/test/test_modulefinder.py index 18cc322072..b62758a8b5 100644 --- a/Lib/test/test_modulefinder.py +++ b/Lib/test/test_modulefinder.py @@ -1,5 +1,5 @@ import __future__ -import sys, os +import os import unittest import distutils.dir_util import tempfile diff --git a/Lib/test/test_multibytecodec_support.py b/Lib/test/test_multibytecodec_support.py index 57a47518b2..60557640be 100644 --- a/Lib/test/test_multibytecodec_support.py +++ b/Lib/test/test_multibytecodec_support.py @@ -4,7 +4,7 @@ # Common Unittest Routines for CJK codecs # -import sys, codecs, os.path +import sys, codecs import unittest, re from test import test_support from StringIO import StringIO diff --git a/Lib/test/test_optparse.py b/Lib/test/test_optparse.py index 38d5207b0c..7a917d8574 100644 --- a/Lib/test/test_optparse.py +++ b/Lib/test/test_optparse.py @@ -16,7 +16,6 @@ import types import unittest from StringIO import StringIO -from pprint import pprint from test import test_support diff --git a/Lib/test/test_ossaudiodev.py b/Lib/test/test_ossaudiodev.py index 83cc344fea..f2ce67bad7 100644 --- a/Lib/test/test_ossaudiodev.py +++ b/Lib/test/test_ossaudiodev.py @@ -1,14 +1,11 @@ from test import test_support test_support.requires('audio') -from test.test_support import verbose, findfile, TestSkipped +from test.test_support import findfile, TestSkipped import errno -import fcntl import ossaudiodev -import os import sys -import select import sunaudio import time import audioop diff --git a/Lib/test/test_pickle.py b/Lib/test/test_pickle.py index 585644e100..fb10ffed16 100644 --- a/Lib/test/test_pickle.py +++ b/Lib/test/test_pickle.py @@ -1,5 +1,4 @@ import pickle -import unittest from cStringIO import StringIO from test import test_support diff --git a/Lib/test/test_pkg.py b/Lib/test/test_pkg.py index 28f994316e..4fa367f560 100644 --- a/Lib/test/test_pkg.py +++ b/Lib/test/test_pkg.py @@ -4,7 +4,6 @@ import sys import os import tempfile import textwrap -import traceback import unittest from test import test_support diff --git a/Lib/test/test_plistlib.py b/Lib/test/test_plistlib.py index 8e8d3e3809..47630dce29 100644 --- a/Lib/test/test_plistlib.py +++ b/Lib/test/test_plistlib.py @@ -3,7 +3,6 @@ import unittest import plistlib import os -import time import datetime from test import test_support diff --git a/Lib/test/test_poll.py b/Lib/test/test_poll.py index 60cd3f4b05..5dbfc2c986 100644 --- a/Lib/test/test_poll.py +++ b/Lib/test/test_poll.py @@ -1,6 +1,6 @@ # Test case for the os.poll() function -import sys, os, select, random, unittest +import os, select, random, unittest from test.test_support import TestSkipped, TESTFN, run_unittest try: diff --git a/Lib/test/test_posix.py b/Lib/test/test_posix.py index 7207de54ea..1fb3c4859d 100644 --- a/Lib/test/test_posix.py +++ b/Lib/test/test_posix.py @@ -9,7 +9,6 @@ except ImportError: import time import os -import sys import unittest import warnings warnings.filterwarnings('ignore', '.* potential security risk .*', diff --git a/Lib/test/test_pyclbr.py b/Lib/test/test_pyclbr.py index 56fb683050..d1291a0d62 100644 --- a/Lib/test/test_pyclbr.py +++ b/Lib/test/test_pyclbr.py @@ -3,7 +3,7 @@ Nick Mathewson ''' from test.test_support import run_unittest -import unittest, sys +import sys from types import ClassType, FunctionType, MethodType, BuiltinFunctionType import pyclbr from unittest import TestCase diff --git a/Lib/test/test_quopri.py b/Lib/test/test_quopri.py index 631c974358..24a2f44b38 100644 --- a/Lib/test/test_quopri.py +++ b/Lib/test/test_quopri.py @@ -1,7 +1,7 @@ from test import test_support import unittest -import sys, os, cStringIO, subprocess +import sys, cStringIO, subprocess import quopri diff --git a/Lib/test/test_resource.py b/Lib/test/test_resource.py index 225f88278d..f354a1b637 100644 --- a/Lib/test/test_resource.py +++ b/Lib/test/test_resource.py @@ -1,7 +1,6 @@ import unittest from test import test_support -import os import resource import time diff --git a/Lib/test/test_rfc822.py b/Lib/test/test_rfc822.py index 6d22825ddf..197887d4aa 100644 --- a/Lib/test/test_rfc822.py +++ b/Lib/test/test_rfc822.py @@ -1,5 +1,4 @@ import rfc822 -import sys import unittest from test import test_support diff --git a/Lib/test/test_scriptpackages.py b/Lib/test/test_scriptpackages.py index a2e03f91e6..ee14be2bb4 100644 --- a/Lib/test/test_scriptpackages.py +++ b/Lib/test/test_scriptpackages.py @@ -1,9 +1,6 @@ # Copyright (C) 2003 Python Software Foundation import unittest -import os -import sys -import tempfile from test import test_support import aetools diff --git a/Lib/test/test_sgmllib.py b/Lib/test/test_sgmllib.py index b6986360ac..d9c9ddc2f5 100644 --- a/Lib/test/test_sgmllib.py +++ b/Lib/test/test_sgmllib.py @@ -1,4 +1,3 @@ -import htmlentitydefs import pprint import re import sgmllib @@ -116,7 +115,7 @@ class SGMLParserTestCase(unittest.TestCase): try: events = self.get_events(source) except: - import sys + #import sys #print >>sys.stderr, pprint.pformat(self.events) raise if events != expected_events: diff --git a/Lib/test/test_shlex.py b/Lib/test/test_shlex.py index 5c6572a9ea..6c35f491b5 100644 --- a/Lib/test/test_shlex.py +++ b/Lib/test/test_shlex.py @@ -1,6 +1,5 @@ # -*- coding: iso-8859-1 -*- import unittest -import os, sys import shlex from test import test_support diff --git a/Lib/test/test_site.py b/Lib/test/test_site.py index 3a8b9d3144..c9957df498 100644 --- a/Lib/test/test_site.py +++ b/Lib/test/test_site.py @@ -5,12 +5,11 @@ executing have not been removed. """ import unittest -from test.test_support import TestSkipped, TestFailed, run_unittest, TESTFN +from test.test_support import TestSkipped, run_unittest, TESTFN import __builtin__ import os import sys import encodings -import tempfile # Need to make sure to not import 'site' if someone specified ``-S`` at the # command-line. Detect this by just making sure 'site' has not been imported # already. diff --git a/Lib/test/test_socketserver.py b/Lib/test/test_socketserver.py index 79f3038ecf..07dd778044 100644 --- a/Lib/test/test_socketserver.py +++ b/Lib/test/test_socketserver.py @@ -9,7 +9,6 @@ import imp import select import time import threading -from functools import wraps import unittest import SocketServer diff --git a/Lib/test/test_sqlite.py b/Lib/test/test_sqlite.py index f033772df6..c1523e11ba 100644 --- a/Lib/test/test_sqlite.py +++ b/Lib/test/test_sqlite.py @@ -1,5 +1,4 @@ from test.test_support import run_unittest, TestSkipped -import unittest try: import _sqlite3 diff --git a/Lib/test/test_str.py b/Lib/test/test_str.py index 7ea46bb52b..37db252a27 100644 --- a/Lib/test/test_str.py +++ b/Lib/test/test_str.py @@ -1,5 +1,4 @@ -import unittest import struct import sys from test import test_support, string_tests diff --git a/Lib/test/test_strftime.py b/Lib/test/test_strftime.py index e9d3826f40..1105c00ea1 100755 --- a/Lib/test/test_strftime.py +++ b/Lib/test/test_strftime.py @@ -2,7 +2,7 @@ # Sanity checker for time.strftime -import time, calendar, sys, os, re +import time, calendar, sys, re from test.test_support import verbose def main(): diff --git a/Lib/test/test_sunaudiodev.py b/Lib/test/test_sunaudiodev.py index f203d9a304..375054207f 100644 --- a/Lib/test/test_sunaudiodev.py +++ b/Lib/test/test_sunaudiodev.py @@ -1,4 +1,4 @@ -from test.test_support import verbose, findfile, TestFailed, TestSkipped +from test.test_support import findfile, TestFailed, TestSkipped import sunaudiodev import os diff --git a/Lib/test/test_support.py b/Lib/test/test_support.py index 9b4372ce28..d36d81cfce 100644 --- a/Lib/test/test_support.py +++ b/Lib/test/test_support.py @@ -10,7 +10,6 @@ import sys import os import os.path import warnings -import types import unittest class Error(Exception): diff --git a/Lib/test/test_tuple.py b/Lib/test/test_tuple.py index dddb03ecc7..c4137098e5 100644 --- a/Lib/test/test_tuple.py +++ b/Lib/test/test_tuple.py @@ -1,4 +1,3 @@ -import unittest from test import test_support, seq_tests class TupleTest(seq_tests.CommonTest): diff --git a/Lib/test/test_unicode.py b/Lib/test/test_unicode.py index ccb9411f55..bdc7192b62 100644 --- a/Lib/test/test_unicode.py +++ b/Lib/test/test_unicode.py @@ -6,7 +6,7 @@ Written by Marc-Andre Lemburg (mal@lemburg.com). (c) Copyright CNRI, All Rights Reserved. NO WARRANTY. """#" -import unittest, sys, struct, codecs, new +import sys, struct, codecs from test import test_support, string_tests # Error handling (bad decoder return) diff --git a/Lib/test/test_unpack.py b/Lib/test/test_unpack.py index 76a4822804..7ddbc62118 100644 --- a/Lib/test/test_unpack.py +++ b/Lib/test/test_unpack.py @@ -122,7 +122,6 @@ error) __test__ = {'doctests' : doctests} def test_main(verbose=False): - import sys from test import test_support from test import test_unpack test_support.run_doctest(test_unpack, verbose) diff --git a/Lib/test/test_urllib.py b/Lib/test/test_urllib.py index 455e7fc7fe..0c669d0276 100644 --- a/Lib/test/test_urllib.py +++ b/Lib/test/test_urllib.py @@ -8,10 +8,6 @@ import os import mimetools import tempfile import StringIO -import ftplib -import threading -import socket -import time def hexescape(char): """Escape char as RFC 2396 specifies""" diff --git a/Lib/test/test_urllib2.py b/Lib/test/test_urllib2.py index a35cbfae84..5727f8a698 100644 --- a/Lib/test/test_urllib2.py +++ b/Lib/test/test_urllib2.py @@ -1,7 +1,7 @@ import unittest from test import test_support -import os, socket +import os import StringIO import urllib2 @@ -589,7 +589,7 @@ class HandlerTests(unittest.TestCase): self.assertEqual(int(headers["Content-length"]), len(data)) def test_file(self): - import time, rfc822, socket + import rfc822, socket h = urllib2.FileHandler() o = h.parent = MockOpener() @@ -993,7 +993,7 @@ class HandlerTests(unittest.TestCase): def _test_basic_auth(self, opener, auth_handler, auth_header, realm, http_handler, password_manager, request_url, protected_url): - import base64, httplib + import base64 user, password = "wile", "coyote" # .add_password() fed through to password manager diff --git a/Lib/test/test_urllib2_localnet.py b/Lib/test/test_urllib2_localnet.py index b347e82160..54bf2d97e1 100644 --- a/Lib/test/test_urllib2_localnet.py +++ b/Lib/test/test_urllib2_localnet.py @@ -1,6 +1,5 @@ #!/usr/bin/env python -import sys import threading import urlparse import urllib2 diff --git a/Lib/test/test_userdict.py b/Lib/test/test_userdict.py index 357c0f04a3..0818e982a6 100644 --- a/Lib/test/test_userdict.py +++ b/Lib/test/test_userdict.py @@ -1,6 +1,5 @@ # Check every path through every method of UserDict -import unittest from test import test_support, mapping_tests import UserDict diff --git a/Lib/test/test_userlist.py b/Lib/test/test_userlist.py index 8c7ef2efe2..ed3e559373 100644 --- a/Lib/test/test_userlist.py +++ b/Lib/test/test_userlist.py @@ -1,7 +1,6 @@ # Check every path through every method of UserList from UserList import UserList -import unittest from test import test_support, list_tests class UserListTest(list_tests.CommonTest): diff --git a/Lib/test/test_userstring.py b/Lib/test/test_userstring.py index b66dffe3f6..06636fcb64 100755 --- a/Lib/test/test_userstring.py +++ b/Lib/test/test_userstring.py @@ -2,7 +2,6 @@ # UserString is a wrapper around the native builtin string type. # UserString instances should behave similar to builtin string objects. -import unittest import string from test import test_support, string_tests diff --git a/Lib/test/test_uu.py b/Lib/test/test_uu.py index 27d0d89e34..9aad56e72e 100644 --- a/Lib/test/test_uu.py +++ b/Lib/test/test_uu.py @@ -8,7 +8,6 @@ from test import test_support import sys, os, uu, cStringIO import uu -from StringIO import StringIO plaintext = "The smooth-scaled python crept over the sleeping dog\n" diff --git a/Lib/test/test_whichdb.py b/Lib/test/test_whichdb.py index f2652c1679..1ce816f866 100644 --- a/Lib/test/test_whichdb.py +++ b/Lib/test/test_whichdb.py @@ -8,7 +8,6 @@ import test.test_support import unittest import whichdb import anydbm -import tempfile import glob _fname = test.test_support.TESTFN diff --git a/Lib/test/test_xml_etree.py b/Lib/test/test_xml_etree.py index 78adb42e19..65c99f1327 100644 --- a/Lib/test/test_xml_etree.py +++ b/Lib/test/test_xml_etree.py @@ -2,7 +2,8 @@ # all included components work as they should. For a more extensive # test suite, see the selftest script in the ElementTree distribution. -import doctest, sys +import doctest +import sys from test import test_support diff --git a/Lib/test/test_xml_etree_c.py b/Lib/test/test_xml_etree_c.py index 250f791073..7ddd44bf81 100644 --- a/Lib/test/test_xml_etree_c.py +++ b/Lib/test/test_xml_etree_c.py @@ -1,6 +1,7 @@ # xml.etree test for cElementTree -import doctest, sys +import doctest +import sys from test import test_support diff --git a/Lib/test/test_xpickle.py b/Lib/test/test_xpickle.py index 42cd0f468a..3ffb74409d 100644 --- a/Lib/test/test_xpickle.py +++ b/Lib/test/test_xpickle.py @@ -5,7 +5,6 @@ import pickle import cPickle -import unittest from test import test_support from test.pickletester import AbstractPickleTests diff --git a/Lib/test/test_zipfile64.py b/Lib/test/test_zipfile64.py index 449cf39d75..6ce2ae593b 100644 --- a/Lib/test/test_zipfile64.py +++ b/Lib/test/test_zipfile64.py @@ -20,7 +20,6 @@ import zipfile, os, unittest import time import sys -from StringIO import StringIO from tempfile import TemporaryFile from test.test_support import TESTFN, run_unittest diff --git a/Mac/Demo/PICTbrowse/ICONbrowse.py b/Mac/Demo/PICTbrowse/ICONbrowse.py index 701ef7f57f..f55070bf53 100644 --- a/Mac/Demo/PICTbrowse/ICONbrowse.py +++ b/Mac/Demo/PICTbrowse/ICONbrowse.py @@ -7,8 +7,6 @@ from Carbon import Qd from Carbon import Win from Carbon import Controls from Carbon import List -import sys -import struct from Carbon import Icn import macresource diff --git a/Mac/Demo/PICTbrowse/PICTbrowse.py b/Mac/Demo/PICTbrowse/PICTbrowse.py index 0adfc83783..f92bdd0117 100644 --- a/Mac/Demo/PICTbrowse/PICTbrowse.py +++ b/Mac/Demo/PICTbrowse/PICTbrowse.py @@ -7,7 +7,6 @@ from Carbon import Qd from Carbon import Win from Carbon import Controls from Carbon import List -import sys import struct import macresource diff --git a/Mac/Demo/PICTbrowse/PICTbrowse2.py b/Mac/Demo/PICTbrowse/PICTbrowse2.py index 84cf8b8107..211d09e602 100644 --- a/Mac/Demo/PICTbrowse/PICTbrowse2.py +++ b/Mac/Demo/PICTbrowse/PICTbrowse2.py @@ -7,7 +7,6 @@ from Carbon import Qd from Carbon import Win from Carbon import Controls from Carbon import List -import sys import struct import macresource diff --git a/Mac/Demo/PICTbrowse/cicnbrowse.py b/Mac/Demo/PICTbrowse/cicnbrowse.py index d95e7c869a..4bc7008ed4 100644 --- a/Mac/Demo/PICTbrowse/cicnbrowse.py +++ b/Mac/Demo/PICTbrowse/cicnbrowse.py @@ -7,8 +7,6 @@ from Carbon import Qd from Carbon import Win from Carbon import Controls from Carbon import List -import sys -import struct from Carbon import Icn import macresource diff --git a/Mac/Demo/PICTbrowse/oldPICTbrowse.py b/Mac/Demo/PICTbrowse/oldPICTbrowse.py index 8600bb2a1e..d15a27d570 100644 --- a/Mac/Demo/PICTbrowse/oldPICTbrowse.py +++ b/Mac/Demo/PICTbrowse/oldPICTbrowse.py @@ -6,7 +6,6 @@ from Carbon import Res from Carbon import Qd from Carbon import Win from Carbon import List -import sys import struct import macresource diff --git a/Mac/Demo/example1/dnslookup-1.py b/Mac/Demo/example1/dnslookup-1.py index 2fb8dc4405..6eb2c73f73 100644 --- a/Mac/Demo/example1/dnslookup-1.py +++ b/Mac/Demo/example1/dnslookup-1.py @@ -4,7 +4,6 @@ Res and Dlg in the process""" import EasyDialogs from Carbon import Res from Carbon import Dlg -import sys import socket import string import macresource diff --git a/Mac/Demo/example2/dnslookup-2.py b/Mac/Demo/example2/dnslookup-2.py index 92cd181af5..fc3db668cc 100644 --- a/Mac/Demo/example2/dnslookup-2.py +++ b/Mac/Demo/example2/dnslookup-2.py @@ -2,7 +2,6 @@ import FrameWork import EasyDialogs from Carbon import Res from Carbon import Dlg -import sys import socket import string import macresource diff --git a/Mac/Demo/imgbrowse/imgbrowse.py b/Mac/Demo/imgbrowse/imgbrowse.py index 28dffd3767..e38e5d8633 100644 --- a/Mac/Demo/imgbrowse/imgbrowse.py +++ b/Mac/Demo/imgbrowse/imgbrowse.py @@ -7,11 +7,9 @@ from Carbon import Qd from Carbon import QuickDraw from Carbon import Win #ifrom Carbon mport List -import sys import struct import img import imgformat -import struct import mac_image diff --git a/Mac/Demo/imgbrowse/mac_image.py b/Mac/Demo/imgbrowse/mac_image.py index 9c9eeb72fc..b6fb274427 100644 --- a/Mac/Demo/imgbrowse/mac_image.py +++ b/Mac/Demo/imgbrowse/mac_image.py @@ -1,7 +1,6 @@ """mac_image - Helper routines (hacks) for images""" import imgformat from Carbon import Qd -import time import struct import MacOS diff --git a/Mac/Demo/sound/morse.py b/Mac/Demo/sound/morse.py index b26d5541af..b6919c5fb1 100644 --- a/Mac/Demo/sound/morse.py +++ b/Mac/Demo/sound/morse.py @@ -1,4 +1,4 @@ -import sys, math, audiodev +import sys, math DOT = 30 DAH = 80 diff --git a/Mac/Modules/ae/aescan.py b/Mac/Modules/ae/aescan.py index 1283c1dcd2..ce19a5e25c 100644 --- a/Mac/Modules/ae/aescan.py +++ b/Mac/Modules/ae/aescan.py @@ -3,8 +3,6 @@ # (Should learn how to tell the compiler to compile it as well.) import sys -import os -import string import MacOS from bgenlocations import TOOLBOXDIR, BGENDIR diff --git a/Mac/Modules/ah/ahscan.py b/Mac/Modules/ah/ahscan.py index 0b7fe081f8..b993427728 100644 --- a/Mac/Modules/ah/ahscan.py +++ b/Mac/Modules/ah/ahscan.py @@ -1,7 +1,6 @@ # Scan an Apple header file, generating a Python file of generator calls. import sys -import os from bgenlocations import TOOLBOXDIR, BGENDIR sys.path.append(BGENDIR) from scantools import Scanner_OSX diff --git a/Mac/Modules/app/appscan.py b/Mac/Modules/app/appscan.py index 1b04859ef2..94eee474c1 100644 --- a/Mac/Modules/app/appscan.py +++ b/Mac/Modules/app/appscan.py @@ -1,7 +1,6 @@ # Scan an Apple header file, generating a Python file of generator calls. import sys -import os from bgenlocations import TOOLBOXDIR, BGENDIR sys.path.append(BGENDIR) from scantools import Scanner diff --git a/Mac/Modules/carbonevt/CarbonEvtscan.py b/Mac/Modules/carbonevt/CarbonEvtscan.py index e3c72ae23d..31e2336b1d 100644 --- a/Mac/Modules/carbonevt/CarbonEvtscan.py +++ b/Mac/Modules/carbonevt/CarbonEvtscan.py @@ -1,8 +1,6 @@ # IBCarbonscan.py import sys -import os -import string import MacOS import sys diff --git a/Mac/Modules/cf/cfscan.py b/Mac/Modules/cf/cfscan.py index d2de92e2da..6de4f1edc8 100644 --- a/Mac/Modules/cf/cfscan.py +++ b/Mac/Modules/cf/cfscan.py @@ -1,7 +1,6 @@ # Scan an Apple header file, generating a Python file of generator calls. import sys -import os from bgenlocations import TOOLBOXDIR, BGENDIR sys.path.append(BGENDIR) from scantools import Scanner_OSX diff --git a/Mac/Modules/cg/cgscan.py b/Mac/Modules/cg/cgscan.py index b2e7946195..c08394ee2d 100755 --- a/Mac/Modules/cg/cgscan.py +++ b/Mac/Modules/cg/cgscan.py @@ -1,7 +1,6 @@ # Scan an Apple header file, generating a Python file of generator calls. import sys -import os from bgenlocations import TOOLBOXDIR, BGENDIR sys.path.append(BGENDIR) from scantools import Scanner_OSX diff --git a/Mac/Modules/cm/cmscan.py b/Mac/Modules/cm/cmscan.py index 087f2393df..73261f58b2 100644 --- a/Mac/Modules/cm/cmscan.py +++ b/Mac/Modules/cm/cmscan.py @@ -1,7 +1,6 @@ # Scan an Apple header file, generating a Python file of generator calls. import sys -import os from bgenlocations import TOOLBOXDIR, BGENDIR sys.path.append(BGENDIR) from scantools import Scanner diff --git a/Mac/Modules/ctl/ctlscan.py b/Mac/Modules/ctl/ctlscan.py index 25333f1fa0..9cb30d15c1 100644 --- a/Mac/Modules/ctl/ctlscan.py +++ b/Mac/Modules/ctl/ctlscan.py @@ -1,6 +1,5 @@ # Scan , generating ctlgen.py. import sys -import os from bgenlocations import TOOLBOXDIR, BGENDIR sys.path.append(BGENDIR) diff --git a/Mac/Modules/dlg/dlgscan.py b/Mac/Modules/dlg/dlgscan.py index 7fb68f7cb1..a4d6d5b974 100644 --- a/Mac/Modules/dlg/dlgscan.py +++ b/Mac/Modules/dlg/dlgscan.py @@ -1,7 +1,6 @@ # Scan an Apple header file, generating a Python file of generator calls. import sys -import os from bgenlocations import TOOLBOXDIR, BGENDIR sys.path.append(BGENDIR) diff --git a/Mac/Modules/drag/dragscan.py b/Mac/Modules/drag/dragscan.py index 923a56bd4d..bd419c4a6f 100644 --- a/Mac/Modules/drag/dragscan.py +++ b/Mac/Modules/drag/dragscan.py @@ -1,6 +1,5 @@ # Scan , generating draggen.py. import sys -import os from bgenlocations import TOOLBOXDIR, BGENDIR, INCLUDEDIR sys.path.append(BGENDIR) diff --git a/Mac/Modules/evt/evtscan.py b/Mac/Modules/evt/evtscan.py index 0d0c9ec4df..ea0692cfe1 100644 --- a/Mac/Modules/evt/evtscan.py +++ b/Mac/Modules/evt/evtscan.py @@ -1,7 +1,6 @@ # Scan an Apple header file, generating a Python file of generator calls. import sys -import os from bgenlocations import TOOLBOXDIR, BGENDIR sys.path.append(BGENDIR) from scantools import Scanner diff --git a/Mac/Modules/file/filescan.py b/Mac/Modules/file/filescan.py index 8ebc69fe4e..4b70823745 100644 --- a/Mac/Modules/file/filescan.py +++ b/Mac/Modules/file/filescan.py @@ -1,7 +1,6 @@ # Scan an Apple header file, generating a Python file of generator calls. import sys -import os from bgenlocations import TOOLBOXDIR, BGENDIR sys.path.append(BGENDIR) from scantools import Scanner_OSX diff --git a/Mac/Modules/fm/fmscan.py b/Mac/Modules/fm/fmscan.py index 334d5eca15..1c0d4122fe 100644 --- a/Mac/Modules/fm/fmscan.py +++ b/Mac/Modules/fm/fmscan.py @@ -1,7 +1,6 @@ # Scan an Apple header file, generating a Python file of generator calls. import sys -import os from bgenlocations import TOOLBOXDIR, BGENDIR sys.path.append(BGENDIR) from scantools import Scanner diff --git a/Mac/Modules/folder/folderscan.py b/Mac/Modules/folder/folderscan.py index 8c94893011..746a333e0f 100644 --- a/Mac/Modules/folder/folderscan.py +++ b/Mac/Modules/folder/folderscan.py @@ -1,7 +1,6 @@ # Scan an Apple header file, generating a Python file of generator calls. import sys -import os from bgenlocations import TOOLBOXDIR, BGENDIR sys.path.append(BGENDIR) from scantools import Scanner_OSX diff --git a/Mac/Modules/help/helpscan.py b/Mac/Modules/help/helpscan.py index 50e0919dc5..b3543b99e4 100644 --- a/Mac/Modules/help/helpscan.py +++ b/Mac/Modules/help/helpscan.py @@ -1,7 +1,6 @@ # Scan an Apple header file, generating a Python file of generator calls. import sys -import os from bgenlocations import TOOLBOXDIR, BGENDIR sys.path.append(BGENDIR) from scantools import Scanner diff --git a/Mac/Modules/ibcarbon/IBCarbonscan.py b/Mac/Modules/ibcarbon/IBCarbonscan.py index 84e4f1e672..f71f864e03 100644 --- a/Mac/Modules/ibcarbon/IBCarbonscan.py +++ b/Mac/Modules/ibcarbon/IBCarbonscan.py @@ -1,8 +1,6 @@ # IBCarbonscan.py import sys -import os -import string from bgenlocations import TOOLBOXDIR, BGENDIR sys.path.append(BGENDIR) diff --git a/Mac/Modules/icn/icnscan.py b/Mac/Modules/icn/icnscan.py index bdc3b84413..6af3a4ea0f 100644 --- a/Mac/Modules/icn/icnscan.py +++ b/Mac/Modules/icn/icnscan.py @@ -1,7 +1,6 @@ # Scan an Apple header file, generating a Python file of generator calls. import sys -import os from bgenlocations import TOOLBOXDIR, BGENDIR sys.path.append(BGENDIR) from scantools import Scanner diff --git a/Mac/Modules/launch/launchscan.py b/Mac/Modules/launch/launchscan.py index 621033ba87..3e07238431 100644 --- a/Mac/Modules/launch/launchscan.py +++ b/Mac/Modules/launch/launchscan.py @@ -1,7 +1,6 @@ # Scan an Apple header file, generating a Python file of generator calls. import sys -import os from bgenlocations import TOOLBOXDIR, BGENDIR sys.path.append(BGENDIR) from scantools import Scanner diff --git a/Mac/Modules/list/listscan.py b/Mac/Modules/list/listscan.py index 877f6cb48b..a0274595be 100644 --- a/Mac/Modules/list/listscan.py +++ b/Mac/Modules/list/listscan.py @@ -1,7 +1,6 @@ # Scan an Apple header file, generating a Python file of generator calls. import sys -import os from bgenlocations import TOOLBOXDIR, BGENDIR sys.path.append(BGENDIR) from scantools import Scanner diff --git a/Mac/Modules/menu/menuscan.py b/Mac/Modules/menu/menuscan.py index ae9465ea14..8151581feb 100644 --- a/Mac/Modules/menu/menuscan.py +++ b/Mac/Modules/menu/menuscan.py @@ -1,6 +1,5 @@ # Scan , generating menugen.py. import sys -import os from bgenlocations import TOOLBOXDIR, BGENDIR sys.path.append(BGENDIR) diff --git a/Mac/Modules/mlte/mltescan.py b/Mac/Modules/mlte/mltescan.py index adecb4fbec..e48a229de7 100644 --- a/Mac/Modules/mlte/mltescan.py +++ b/Mac/Modules/mlte/mltescan.py @@ -1,7 +1,6 @@ # Scan an Apple header file, generating a Python file of generator calls. import sys -import os from bgenlocations import TOOLBOXDIR, BGENDIR sys.path.append(BGENDIR) from scantools import Scanner_OSX diff --git a/Mac/Modules/osa/osascan.py b/Mac/Modules/osa/osascan.py index fb8196f67f..5fc2e9f6f0 100644 --- a/Mac/Modules/osa/osascan.py +++ b/Mac/Modules/osa/osascan.py @@ -1,7 +1,6 @@ # Scan an Apple header file, generating a Python file of generator calls. import sys -import os from bgenlocations import TOOLBOXDIR, BGENDIR sys.path.append(BGENDIR) from scantools import Scanner diff --git a/Mac/Modules/qd/qdscan.py b/Mac/Modules/qd/qdscan.py index 85a8cdc04c..24fbb74f88 100644 --- a/Mac/Modules/qd/qdscan.py +++ b/Mac/Modules/qd/qdscan.py @@ -1,7 +1,6 @@ # Scan an Apple header file, generating a Python file of generator calls. import sys -import os from bgenlocations import TOOLBOXDIR, BGENDIR sys.path.append(BGENDIR) diff --git a/Mac/Modules/qdoffs/qdoffsscan.py b/Mac/Modules/qdoffs/qdoffsscan.py index d456e004e2..0ad98028b4 100644 --- a/Mac/Modules/qdoffs/qdoffsscan.py +++ b/Mac/Modules/qdoffs/qdoffsscan.py @@ -1,6 +1,5 @@ # Scan an Apple header file, generating a Python file of generator calls. import sys -import os from bgenlocations import TOOLBOXDIR, BGENDIR sys.path.append(BGENDIR) diff --git a/Mac/Modules/qt/qtscan.py b/Mac/Modules/qt/qtscan.py index a2dba15018..cd001244f6 100644 --- a/Mac/Modules/qt/qtscan.py +++ b/Mac/Modules/qt/qtscan.py @@ -1,7 +1,6 @@ # Scan an Apple header file, generating a Python file of generator calls. import sys -import os from bgenlocations import TOOLBOXDIR, BGENDIR sys.path.append(BGENDIR) from scantools import Scanner diff --git a/Mac/Modules/res/resscan.py b/Mac/Modules/res/resscan.py index 47a97e4285..6966e85819 100644 --- a/Mac/Modules/res/resscan.py +++ b/Mac/Modules/res/resscan.py @@ -3,8 +3,6 @@ # (Should learn how to tell the compiler to compile it as well.) import sys -import os -import string import MacOS from bgenlocations import TOOLBOXDIR, BGENDIR diff --git a/Mac/Modules/scrap/scrapscan.py b/Mac/Modules/scrap/scrapscan.py index 1fc8191265..25a683ca96 100644 --- a/Mac/Modules/scrap/scrapscan.py +++ b/Mac/Modules/scrap/scrapscan.py @@ -4,7 +4,6 @@ # generates a boilerplate to be edited by hand. import sys -import os from bgenlocations import TOOLBOXDIR, BGENDIR sys.path.append(BGENDIR) from scantools import Scanner diff --git a/Mac/Modules/snd/sndscan.py b/Mac/Modules/snd/sndscan.py index c4a82663db..7504aefd93 100644 --- a/Mac/Modules/snd/sndscan.py +++ b/Mac/Modules/snd/sndscan.py @@ -3,7 +3,6 @@ # (Should learn how to tell the compiler to compile it as well.) import sys -import os from bgenlocations import TOOLBOXDIR, BGENDIR sys.path.append(BGENDIR) diff --git a/Mac/Modules/te/tescan.py b/Mac/Modules/te/tescan.py index f5b6fff4d4..6cd25f4661 100644 --- a/Mac/Modules/te/tescan.py +++ b/Mac/Modules/te/tescan.py @@ -1,7 +1,6 @@ # Scan an Apple header file, generating a Python file of generator calls. import sys -import os from bgenlocations import TOOLBOXDIR, BGENDIR sys.path.append(BGENDIR) from scantools import Scanner diff --git a/Mac/Modules/win/winscan.py b/Mac/Modules/win/winscan.py index f78935d0d5..8a2f726da1 100644 --- a/Mac/Modules/win/winscan.py +++ b/Mac/Modules/win/winscan.py @@ -1,6 +1,5 @@ # Scan an Apple header file, generating a Python file of generator calls. import sys -import os from bgenlocations import TOOLBOXDIR, BGENDIR sys.path.append(BGENDIR) diff --git a/Misc/BeOS-setup.py b/Misc/BeOS-setup.py index 991e608fa5..0043a341d4 100644 --- a/Misc/BeOS-setup.py +++ b/Misc/BeOS-setup.py @@ -4,7 +4,7 @@ __version__ = "special BeOS after 1.37" -import sys, os, getopt +import sys, os from distutils import sysconfig from distutils import text_file from distutils.errors import * diff --git a/PC/VS8.0/build_tkinter.py b/PC/VS8.0/build_tkinter.py index defafe8153..ea59039b97 100644 --- a/PC/VS8.0/build_tkinter.py +++ b/PC/VS8.0/build_tkinter.py @@ -7,7 +7,6 @@ Licensed to PSF under a Contributor Agreement. import os import sys -import shutil here = os.path.abspath(os.path.dirname(__file__)) par = os.path.pardir diff --git a/PCbuild/build_tkinter.py b/PCbuild/build_tkinter.py index 574d768086..0590b0f282 100644 --- a/PCbuild/build_tkinter.py +++ b/PCbuild/build_tkinter.py @@ -7,7 +7,6 @@ Licensed to PSF under a Contributor Agreement. import os import sys -import shutil here = os.path.abspath(os.path.dirname(__file__)) par = os.path.pardir diff --git a/Parser/asdl_c.py b/Parser/asdl_c.py index 4877853dea..17d9dfd3ba 100755 --- a/Parser/asdl_c.py +++ b/Parser/asdl_c.py @@ -4,7 +4,7 @@ # TO DO # handle fields that have a type but no name -import os, sys, traceback +import os, sys import asdl diff --git a/Parser/spark.py b/Parser/spark.py index 2c18623a02..b064d62ec6 100644 --- a/Parser/spark.py +++ b/Parser/spark.py @@ -22,7 +22,6 @@ __version__ = 'SPARK-0.7 (pre-alpha-5)' import re -import sys import string def _namelist(instance): diff --git a/Tools/compiler/astgen.py b/Tools/compiler/astgen.py index 59b98f2b0a..c431d226b9 100644 --- a/Tools/compiler/astgen.py +++ b/Tools/compiler/astgen.py @@ -8,7 +8,6 @@ the Node interface has changed more often than the grammar. """ import fileinput -import getopt import re import sys from StringIO import StringIO diff --git a/Tools/compiler/dumppyc.py b/Tools/compiler/dumppyc.py index 1258cce814..39b96136a7 100755 --- a/Tools/compiler/dumppyc.py +++ b/Tools/compiler/dumppyc.py @@ -1,7 +1,6 @@ #! /usr/bin/env python import marshal -import os import dis import types diff --git a/Tools/faqwiz/faqw.py b/Tools/faqwiz/faqw.py index a26e0d60ee..c6c1a6d616 100755 --- a/Tools/faqwiz/faqw.py +++ b/Tools/faqwiz/faqw.py @@ -20,7 +20,7 @@ t1 = os.times() # If this doesn't work, just get rid of the timing code! try: FAQDIR = "/usr/people/guido/python/FAQ" SRCDIR = "/usr/people/guido/python/src/Tools/faqwiz" - import os, sys, time, operator + import os, sys os.chdir(FAQDIR) sys.path.insert(0, SRCDIR) import faqwiz diff --git a/Tools/modulator/Tkextra.py b/Tools/modulator/Tkextra.py index 8f557286f5..12271069af 100755 --- a/Tools/modulator/Tkextra.py +++ b/Tools/modulator/Tkextra.py @@ -218,7 +218,6 @@ def _go(): 0, 'Save', 'Save as text') def _test(): - import sys global mainWidget mainWidget = Frame() Pack.config(mainWidget) diff --git a/Tools/pybench/systimes.py b/Tools/pybench/systimes.py index bf07e36dd2..c4b952edf0 100644 --- a/Tools/pybench/systimes.py +++ b/Tools/pybench/systimes.py @@ -31,7 +31,7 @@ the author. All Rights Reserved. """ -import time, sys, struct +import time, sys # # Note: Please keep this module compatible to Python 1.5.2. diff --git a/Tools/pynche/ChipViewer.py b/Tools/pynche/ChipViewer.py index 05412cec48..f59aa2819f 100644 --- a/Tools/pynche/ChipViewer.py +++ b/Tools/pynche/ChipViewer.py @@ -13,7 +13,6 @@ The ChipViewer class includes the entire lower left quandrant; i.e. both the selected and nearest ChipWidgets. """ -from types import StringType from Tkinter import * import ColorDB diff --git a/Tools/pynche/TypeinViewer.py b/Tools/pynche/TypeinViewer.py index bcc3cda866..d56c1b32c0 100644 --- a/Tools/pynche/TypeinViewer.py +++ b/Tools/pynche/TypeinViewer.py @@ -12,8 +12,6 @@ color selection will be made on every change to the text field. Otherwise, you must hit Return or Tab to select the color. """ -import sys -import re from Tkinter import * diff --git a/Tools/scripts/logmerge.py b/Tools/scripts/logmerge.py index edfec2c45d..c63819c3e8 100755 --- a/Tools/scripts/logmerge.py +++ b/Tools/scripts/logmerge.py @@ -34,7 +34,7 @@ XXX This code was created by reverse engineering CVS 1.9 and RCS 5.7 from their output. """ -import os, sys, errno, getopt, re +import sys, errno, getopt, re sep1 = '='*77 + '\n' # file separator sep2 = '-'*28 + '\n' # revision separator diff --git a/Tools/scripts/nm2def.py b/Tools/scripts/nm2def.py index 6887ee282d..5f2bc8fc78 100755 --- a/Tools/scripts/nm2def.py +++ b/Tools/scripts/nm2def.py @@ -34,7 +34,7 @@ Even if this isn't the default output of your nm, there is generally an option to produce this format (since it is the original v7 Unix format). """ -import os,re,sys +import os, sys PYTHONLIB = 'libpython'+sys.version[:3]+'.a' PC_PYTHONLIB = 'Python'+sys.version[0]+sys.version[2]+'.dll' diff --git a/Tools/scripts/pindent.py b/Tools/scripts/pindent.py index 89ed9e6999..ec440d14fb 100755 --- a/Tools/scripts/pindent.py +++ b/Tools/scripts/pindent.py @@ -81,7 +81,6 @@ STEPSIZE = 8 TABSIZE = 8 EXPANDTABS = 0 -import os import re import sys diff --git a/Tools/scripts/pysource.py b/Tools/scripts/pysource.py index 71e0ded9cf..a295303f15 100644 --- a/Tools/scripts/pysource.py +++ b/Tools/scripts/pysource.py @@ -20,7 +20,7 @@ __author__ = "Oleg Broytmann, Georg Brandl" __all__ = ["has_python_ext", "looks_like_python", "can_be_compiled", "walk_python_files"] -import sys, os, re +import os, re binary_re = re.compile('[\x00-\x08\x0E-\x1F\x7F]') diff --git a/Tools/scripts/xxci.py b/Tools/scripts/xxci.py index c6a7d08720..ebb044d909 100755 --- a/Tools/scripts/xxci.py +++ b/Tools/scripts/xxci.py @@ -7,7 +7,6 @@ import sys import os from stat import * -import commands import fnmatch EXECMAGIC = '\001\140\000\010' diff --git a/Tools/ssl/get-remote-certificate.py b/Tools/ssl/get-remote-certificate.py index cbcd76f421..b63428abd4 100644 --- a/Tools/ssl/get-remote-certificate.py +++ b/Tools/ssl/get-remote-certificate.py @@ -6,7 +6,7 @@ # # By Bill Janssen. -import sys, os +import sys def fetch_server_certificate (host, port): diff --git a/Tools/unicode/gencodec.py b/Tools/unicode/gencodec.py index 8a2ca64474..431a76ddc5 100644 --- a/Tools/unicode/gencodec.py +++ b/Tools/unicode/gencodec.py @@ -26,7 +26,7 @@ Table generation: """#" -import re, os, time, marshal, codecs +import re, os, marshal, codecs # Maximum allowed size of charmap tables MAX_TABLE_SIZE = 8192 diff --git a/Tools/webchecker/wcgui.py b/Tools/webchecker/wcgui.py index 96aed0a6b2..cfc4098ef8 100755 --- a/Tools/webchecker/wcgui.py +++ b/Tools/webchecker/wcgui.py @@ -63,7 +63,6 @@ import getopt from Tkinter import * import tktools import webchecker -import random # Override some for a weaker platform if sys.platform == 'mac': diff --git a/Tools/webchecker/wsgui.py b/Tools/webchecker/wsgui.py index 0c851ca5db..95c7ab9e1d 100755 --- a/Tools/webchecker/wsgui.py +++ b/Tools/webchecker/wsgui.py @@ -7,9 +7,7 @@ their respective text boxes, click GO or hit return, and presto. """ from Tkinter import * -import Tkinter import websucker -import sys import os import threading import Queue -- 2.40.0