diff --git a/Lib/SimpleHTTPServer.py b/Lib/SimpleHTTPServer.py index 249e237fb7c..7b6e8679af7 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 c027ada74a1..6d0fff15e43 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 b108db4c6a9..bc165cfbefb 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 2f72b1155b2..2e83a6cb1c8 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 6086d77f72b..dd9909d6d2d 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 ddc05d5d4dd..bd399a431ac 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 3a401e36828..0c9cf5fffa6 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 5738febe0ef..efc3460f797 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 5f09cecc6a3..d6454cc736e 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 731f33a4202..26c29124a7b 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 e0d831f7628..18469a19c2d 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 ef9c0aa8b69..3d566f10a9f 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 ef84a4097f8..b87cc689ec1 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 95cf20d0d2b..1acf35a91ff 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 4b36a40a027..9630db19d02 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 239e8ee13fa..d7029e5cff5 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 9c87db4abe2..d14f6da1fa0 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 77ac7764bf0..56cc1efe714 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 2b745c206ef..339ec8b4088 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 28be6c619f7..d15bd2efe61 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 0cfe82e1f8e..ed1297dc156 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 c39f3507c0c..8d59f903fc9 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 291fccac14f..4b950291d4c 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 58457413270..dfd84eeac01 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 53352041e9a..9f1d86785db 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 ca524a5b88e..d4fc53366fd 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 23c25a55a87..d6897d2d09b 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 ccba00955ac..f740c468e7f 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 a1c0df4bc54..a4014525b72 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 6f0e0d881cb..9aa70300493 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 b9f39bae79c..be6d2c5b4da 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 6af363b36dd..104be0b349c 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 c62121023d3..0d39b91cc3e 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 2bd1b043678..4895240a4cd 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 08ff543449c..81107a85cb5 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 d1a9100de45..5c588effd3e 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 a06b1953b45..9b37f789827 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 43f9aaaf5bb..6d27cce64fc 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 4d2a7cdf1a1..5ae79332c09 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 770b7c376fd..d56f7e9bc52 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 75e8a5316eb..dc759ee8f53 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 0129d9d4e66..8e76e433c5f 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 ee952d392e2..50010e69b06 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 7d6d91d447d..99d0729494f 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 cd4c51d4836..fb88d581d3d 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 6d27d24466a..c7d8e781df0 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 547df13ee30..51de6390aa8 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 74085c36f51..fa234d17c17 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 c5c171fb83c..5299e0e951d 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 182a1170e83..5896bd5d1b6 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 010ab2c1aa9..acab0534864 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 aff9cac5879..1ce7ff46860 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 6e919827b9c..7827c740e66 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 03475f40607..6948a49325c 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 e8081d6c1f0..a974e83ce63 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 c4a4ac5f705..59f1402288b 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 98247cbf349..6a08dc942d9 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 529a0a4ed85..9ad9c4401ec 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 e7fa3540753..271eb3e10a3 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 fc4861e691b..217f9e8739f 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 7a8badf4463..5d5386e65cc 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 761bdaa6b74..cb0a6216fdf 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 92881440a31..24502e44e0d 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 7eb55f66831..3c75de39d66 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 88bc49d6fda..b3f24d30a9e 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 2ea50945ed2..d9b2d2966e2 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 5a20bf226b8..6a32cb6b625 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 26ed012272b..571e3912b2b 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 ac5f7ee245a..c53dceacbd5 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 d533f1abc04..e915028dca3 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 0bb7e537065..a54594a450c 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 df1ece09c91..51e1a7eb8d3 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 9cf333187a4..fc61d21a22a 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 5aa1c40fa1c..c08df0ba23c 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 d704e4b7345..e3a7e43737b 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 2fde614dd46..13da80d2d4d 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 606ed700dfd..7d5ec7c5b81 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 ff4c987eba2..d2899bd4eab 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 78beda773c0..d6e703a7fa5 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 cb639b41eaf..ee104e45ed5 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 b93e72eb728..4da0932bfc6 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 e0ca746cd09..b69110d88d5 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 4ed76ea10b5..7dd5f068686 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 d0e1c7e8e48..fd508a94a26 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 8c8786a12b1..943fb82182c 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 3724f1e5a4e..dcb9729fe37 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 f609968167e..cb4ee6083e4 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 163e791d8a2..2c814dfdec8 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 aae35182bd1..4d4c03b9d7b 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 96d1bc184ca..bdf8e03f867 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 f6589b76ff7..9fb3ea7f7ab 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 654456adf69..743f0943a49 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 90ca303eca5..fa76fbc1180 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 124a4692b1d..1704a60dc82 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 229bbeddf21..810af6c8cbc 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 6a20c6b81d2..d312ae5fa95 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 bdfd796b1e0..11311c4f437 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 62b14e071bd..f597728b16b 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 323b37b754b..75f24342737 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 5d1d1ce1375..303490bcdc5 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 34895290a64..37507fe8f42 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 1ed6cb279e3..5a96664c29d 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 fcc4c8fec37..97bca2c8a7c 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 cc8b1926b88..e0c7ec3b9fc 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 18cc3220720..b62758a8b52 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 57a47518b2b..60557640be3 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 38d5207b0cc..7a917d8574b 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 83cc344fea9..f2ce67bad79 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 585644e1009..fb10ffed16c 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 28f994316ee..4fa367f5600 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 8e8d3e38094..47630dce297 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 60cd3f4b05b..5dbfc2c9863 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 7207de54eaf..1fb3c4859d2 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 56fb6830505..d1291a0d62e 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 631c9743581..24a2f44b384 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 225f88278de..f354a1b6372 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 6d22825ddf6..197887d4aa9 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 a2e03f91e6c..ee14be2bb4b 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 b6986360ac1..d9c9ddc2f5d 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 5c6572a9ea5..6c35f491b5b 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 3a8b9d31445..c9957df498d 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 79f3038ecf4..07dd7780444 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 f033772df6c..c1523e11ba3 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 7ea46bb52b8..37db252a27f 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 e9d3826f40f..1105c00ea1b 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 f203d9a304b..375054207f5 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 9b4372ce285..d36d81cfced 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 dddb03ecc79..c4137098e5d 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 ccb9411f551..bdc7192b62c 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 76a48228048..7ddbc621184 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 455e7fc7fe5..0c669d02767 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 a35cbfae842..5727f8a6989 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 b347e821605..54bf2d97e12 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 357c0f04a31..0818e982a63 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 8c7ef2efe2b..ed3e5593733 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 b66dffe3f6e..06636fcb643 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 27d0d89e345..9aad56e72e8 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 f2652c1679a..1ce816f866f 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 78adb42e191..65c99f13275 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 250f7910738..7ddd44bf81e 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 42cd0f468a5..3ffb74409dd 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 449cf39d756..6ce2ae593b4 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 701ef7f57fc..f55070bf53e 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 0adfc837831..f92bdd0117e 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 84cf8b8107c..211d09e602e 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 d95e7c869a7..4bc7008ed46 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 8600bb2a1e1..d15a27d5701 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 2fb8dc4405d..6eb2c73f736 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 92cd181af5b..fc3db668cce 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 28dffd37671..e38e5d8633c 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 9c9eeb72fc7..b6fb274427e 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 b26d5541af3..b6919c5fb10 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 1283c1dcd25..ce19a5e25c8 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 0b7fe081f86..b9934277284 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 1b04859ef2d..94eee474c12 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 e3c72ae23de..31e2336b1d4 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 d2de92e2da4..6de4f1edc83 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 b2e79461953..c08394ee2d2 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 087f2393df6..73261f58b28 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 25333f1fa07..9cb30d15c14 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 7fb68f7cb1f..a4d6d5b9741 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 923a56bd4dd..bd419c4a6f4 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 0d0c9ec4df2..ea0692cfe16 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 8ebc69fe4e0..4b708237456 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 334d5eca156..1c0d4122fe5 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 8c94893011f..746a333e0ff 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 50e0919dc52..b3543b99e4c 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 84e4f1e6725..f71f864e03a 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 bdc3b84413e..6af3a4ea0fd 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 621033ba87b..3e07238431d 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 877f6cb48bc..a0274595be6 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 ae9465ea142..8151581feb6 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 adecb4fbecc..e48a229de76 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 fb8196f67f0..5fc2e9f6f09 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 85a8cdc04c1..24fbb74f88b 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 d456e004e26..0ad98028b41 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 a2dba150184..cd001244f62 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 47a97e42855..6966e858196 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 1fc81912657..25a683ca96a 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 c4a82663db5..7504aefd93b 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 f5b6fff4d42..6cd25f46611 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 f78935d0d51..8a2f726da1b 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 991e608fa50..0043a341d4a 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 defafe81537..ea59039b97a 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 574d7680861..0590b0f282e 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 4877853deab..17d9dfd3ba3 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 2c18623a029..b064d62ec68 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 59b98f2b0a1..c431d226b9d 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 1258cce8143..39b96136a74 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 a26e0d60eed..c6c1a6d616a 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 8f557286f50..12271069af4 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 bf07e36dd28..c4b952edf09 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 05412cec48b..f59aa2819fa 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 bcc3cda8662..d56c1b32c09 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 edfec2c45d3..c63819c3e8c 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 6887ee282d4..5f2bc8fc781 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 89ed9e69998..ec440d14fb3 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 71e0ded9cf5..a295303f15f 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 c6a7d087209..ebb044d9096 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 cbcd76f4217..b63428abd4a 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 8a2ca644746..431a76ddc59 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 96aed0a6b28..cfc4098ef84 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 0c851ca5db3..95c7ab9e1d7 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