]> git.ipfire.org Git - thirdparty/Python/cpython.git/commitdiff
Removed unused imports.
authorSerhiy Storchaka <storchaka@gmail.com>
Sun, 24 Apr 2016 21:12:32 +0000 (00:12 +0300)
committerSerhiy Storchaka <storchaka@gmail.com>
Sun, 24 Apr 2016 21:12:32 +0000 (00:12 +0300)
26 files changed:
Lib/distutils/command/config.py
Lib/distutils/command/register.py
Lib/distutils/command/sdist.py
Lib/distutils/extension.py
Lib/distutils/text_file.py
Lib/ftplib.py
Lib/idlelib/help.py
Lib/idlelib/macosxSupport.py
Lib/lib2to3/fixer_util.py
Lib/lib2to3/fixes/fix_dict.py
Lib/lib2to3/fixes/fix_exec.py
Lib/lib2to3/fixes/fix_filter.py
Lib/lib2to3/fixes/fix_has_key.py
Lib/lib2to3/fixes/fix_metaclass.py
Lib/lib2to3/fixes/fix_nonzero.py
Lib/lib2to3/fixes/fix_print.py
Lib/lib2to3/fixes/fix_types.py
Lib/lib2to3/fixes/fix_urllib.py
Lib/lib2to3/refactor.py
Lib/pyclbr.py
Lib/re.py
Lib/turtledemo/__main__.py
Lib/turtledemo/bytedesign.py
Lib/turtledemo/planet_and_moon.py
Lib/uuid.py
Tools/scripts/diff.py

index 847e8581605b16af2eebfb0d78edcbf652b141e7..b1fd09e0160dab8f0c781192d46b8b164a6511e0 100644 (file)
@@ -9,7 +9,7 @@ configure-like tasks: "try to compile this C code", or "figure out where
 this header file lives".
 """
 
-import sys, os, re
+import os, re
 
 from distutils.core import Command
 from distutils.errors import DistutilsExecError
index b49f86fe5814240641db8a5ab54e209a7eb709ef..a3e0893a0bc9102b416eac1dcdc617d9364871d0 100644 (file)
@@ -5,7 +5,7 @@ Implements the Distutils 'register' command (register with the repository).
 
 # created 2002/10/21, Richard Jones
 
-import os, string, getpass
+import getpass
 import io
 import urllib.parse, urllib.request
 from warnings import warn
index 7ea3d5fa27ebb5371ce66b81eb5c9bd29cad59a9..35a06eb09b7ca9fd6b6f28c0f1b1adaed8fed7bc 100644 (file)
@@ -3,7 +3,6 @@
 Implements the Distutils 'sdist' command (create a source distribution)."""
 
 import os
-import string
 import sys
 from types import *
 from glob import glob
index 7efbb74f8953b564ffafcee37d0ff3897e0833e1..c507da360aa3d9ccff7a6ed0249ddf03df521c39 100644 (file)
@@ -4,7 +4,6 @@ Provides the Extension class, used to describe C/C++ extension
 modules in setup scripts."""
 
 import os
-import sys
 import warnings
 
 # This class is really only used by the "build_ext" command, so it might
index 478336f0d2b8dccd9abd2080017ff0767963b39c..93abad38f434d7ecf8d208cdefc310bd73a5a673 100644 (file)
@@ -4,7 +4,7 @@ provides the TextFile class, which gives an interface to text files
 that (optionally) takes care of stripping comments, ignoring blank
 lines, and joining lines with backslashes."""
 
-import sys, os, io
+import sys, io
 
 
 class TextFile:
index 2afa19de432de235e738579889c9b8731cd7dcfa..2ab1d568d74d8d5688ce3faeab4b07cf7858dc90 100644 (file)
@@ -36,10 +36,8 @@ python ftplib.py -d localhost -l -p -l
 # Modified by Giampaolo Rodola' to add TLS support.
 #
 
-import os
 import sys
 import socket
-import warnings
 from socket import _GLOBAL_DEFAULT_TIMEOUT
 
 __all__ = ["FTP", "error_reply", "error_temp", "error_perm", "error_proto",
index d0c59c5fcf9d5349f94b019155ab9036306042ea..4cb8c763905ebe522a369499d9fc936ff83305fd 100644 (file)
@@ -25,8 +25,8 @@ copy_strip - Copy idle.html to help.html, rstripping each line.
 show_idlehelp - Create HelpWindow.  Called in EditorWindow.help_dialog.
 """
 from html.parser import HTMLParser
-from os.path import abspath, dirname, isdir, isfile, join
-from tkinter import Tk, Toplevel, Frame, Text, Scrollbar, Menu, Menubutton
+from os.path import abspath, dirname, isfile, join
+from tkinter import Toplevel, Frame, Text, Scrollbar, Menu, Menubutton
 from tkinter import font as tkfont
 from idlelib.configHandler import idleConf
 
index b96bae1d55086bb53e5d381b34ce1dd4586a69a1..268426fd2bda9d900b48a127d3d838b3505ad8b2 100644 (file)
@@ -3,7 +3,6 @@ A number of functions that enhance IDLE on Mac OSX.
 """
 import sys
 import tkinter
-from os import path
 import warnings
 
 def runningAsOSXApp():
index 44502bf7bdbd48b752ae0e10e92622f600536cd3..babe6cb3f662a961b2f89d3a9023344327afa036 100644 (file)
@@ -1,8 +1,6 @@
 """Utility functions, node construction macros, etc."""
 # Author: Collin Winter
 
-from itertools import islice
-
 # Local imports
 from .pgen2 import token
 from .pytree import Leaf, Node
index 963f952e0b04221eedc983df3a9fd359fcc0c9d1..d3655c9f1b2d9bf82d8ce3a2140cfeff9ba97323 100644 (file)
@@ -30,9 +30,8 @@ as an argument to a function that introspects the argument).
 # Local imports
 from .. import pytree
 from .. import patcomp
-from ..pgen2 import token
 from .. import fixer_base
-from ..fixer_util import Name, Call, LParen, RParen, ArgList, Dot
+from ..fixer_util import Name, Call, Dot
 from .. import fixer_util
 
 
index 2c9b72d5425343a8b150f364fe853a98843379cd..ab921ee80cdf366532f027b2549e5bcba55a4fd5 100644 (file)
@@ -10,7 +10,6 @@ exec code in ns1, ns2 -> exec(code, ns1, ns2)
 """
 
 # Local imports
-from .. import pytree
 from .. import fixer_base
 from ..fixer_util import Comma, Name, Call
 
index 391889f9132a857c9a81cb366b35ec52d32be8a0..bb6718cbf770f5f8df01d9cc96c217a1b918ef2c 100644 (file)
@@ -14,7 +14,6 @@ Python 2.6 figure it out.
 """
 
 # Local imports
-from ..pgen2 import token
 from .. import fixer_base
 from ..fixer_util import Name, Call, ListComp, in_special_context
 
index 18c560fd850fc14977656f9344d88c8b27e747c7..439708c9923404312dfabb964615062ea32c0aea 100644 (file)
@@ -31,7 +31,6 @@ CAVEATS:
 
 # Local imports
 from .. import pytree
-from ..pgen2 import token
 from .. import fixer_base
 from ..fixer_util import Name, parenthesize
 
index f3f87085706f9a405d7366993d0443054dcf8493..eca3334ce63a15bba116058f68e65c31f07ee984 100644 (file)
@@ -20,7 +20,7 @@
 # Local imports
 from .. import fixer_base
 from ..pygram import token
-from ..fixer_util import Name, syms, Node, Leaf
+from ..fixer_util import syms, Node, Leaf
 
 
 def has_metaclass(parent):
index ad91a29e43c7deff28247536f1c95ac0655fd6b2..c2295969a7728f78617677b01aac8122fa15539c 100644 (file)
@@ -3,7 +3,7 @@
 
 # Local imports
 from .. import fixer_base
-from ..fixer_util import Name, syms
+from ..fixer_util import Name
 
 class FixNonzero(fixer_base.BaseFix):
     BM_compatible = True
index a1fe2f5c782c64b13bf03edb98615a8dee509010..8780322265f6fe526cb35e7961f3cfb5aaa8e052 100644 (file)
@@ -18,7 +18,7 @@ from .. import patcomp
 from .. import pytree
 from ..pgen2 import token
 from .. import fixer_base
-from ..fixer_util import Name, Call, Comma, String, is_tuple
+from ..fixer_util import Name, Call, Comma, String
 
 
 parend_expr = patcomp.compile_pattern(
index 00327a78e8eba50512c7950b689a979b287c6dd8..67bf51f2f5b85a6a2f6a4c6427a5d9893f0c4350 100644 (file)
@@ -20,7 +20,6 @@ There should be another fixer that handles at least the following constants:
 """
 
 # Local imports
-from ..pgen2 import token
 from .. import fixer_base
 from ..fixer_util import Name
 
index 1481cd91e3cf37cda4c763b0655f42c64b4c51f4..5a36049df5cb064809d6da4b3ba55061f3ed87d7 100644 (file)
@@ -6,7 +6,6 @@
 
 # Local imports
 from lib2to3.fixes.fix_imports import alternates, FixImports
-from lib2to3 import fixer_base
 from lib2to3.fixer_util import (Name, Comma, FromImport, Newline,
                                 find_indentation, Node, syms)
 
index 0728083652da3aec25527bdb3711886e404f4d64..b60b9def4d07c484fa9bc64b38c220498c6d5ee3 100644 (file)
@@ -26,7 +26,6 @@ from itertools import chain
 from .pgen2 import driver, tokenize, token
 from .fixer_util import find_root
 from . import pytree, pygram
-from . import btm_utils as bu
 from . import btm_matcher as bm
 
 
index 4d40b87f164ecc33baeb4db755a513318f4f7c06..d7dba9761851ea8ff4439d557cf704c7f701b501 100644 (file)
@@ -40,12 +40,10 @@ Instances of this class have the following instance variables:
 """
 
 import io
-import os
 import sys
 import importlib.util
 import tokenize
 from token import NAME, DEDENT, OP
-from operator import itemgetter
 
 __all__ = ["readmodule", "readmodule_ex", "Class", "Function"]
 
@@ -328,6 +326,7 @@ def _getname(g):
 def _main():
     # Main program for testing.
     import os
+    from operator import itemgetter
     mod = sys.argv[1]
     if os.path.exists(mod):
         path = [os.path.dirname(mod)]
index dde8901c626f52aae9374d8e04511605b4d57325..661929e76b414f6526c6a91c8a089f2ce1907992 100644 (file)
--- a/Lib/re.py
+++ b/Lib/re.py
@@ -119,7 +119,6 @@ This module also defines an exception 'error'.
 
 """
 
-import sys
 import sre_compile
 import sre_parse
 try:
index 106d058808993a7580d4fd1c794932dd94d7ae37..d9b3dd5ef2455587137f479cb8bfe2ceaa838406 100644 (file)
@@ -95,7 +95,6 @@ from idlelib.textView import view_text
 from turtledemo import __doc__ as about_turtledemo
 
 import turtle
-import time
 
 demo_dir = os.path.dirname(os.path.abspath(__file__))
 darwin = sys.platform == 'darwin'
index 64b1d7d5b0327f708918749e9dc37675b4c80da8..b3b095b76871af1d413a4e52d8601cbca85e0225 100755 (executable)
@@ -22,7 +22,6 @@ to 0, this animation runs in "line per line"
 mode as fast as possible.
 """
 
-import math
 from turtle import Turtle, mainloop
 from time import clock
 
index 26abfdb0690a5281f57299ad73dd8704bf0ceb74..021ff99383aa65122b663f394b9d55bf57a24e9d 100755 (executable)
@@ -18,7 +18,6 @@ mouse over the scrollbar of the canvas.
 
 """
 from turtle import Shape, Turtle, mainloop, Vec2D as Vec
-from time import sleep
 
 G = 8
 
index e96e7e034cc5e5a28f78f6abf8acad39d854327d..200c800b34e4bbd36e124c7b5326126fba5716e9 100644 (file)
@@ -487,7 +487,6 @@ try:
     # Assume that the uuid_generate functions are broken from 10.5 onward,
     # the test can be adjusted when a later version is fixed.
     if sys.platform == 'darwin':
-        import os
         if int(os.uname().release.split('.')[0]) >= 9:
             _uuid_generate_time = None
 
index 9720a431557aec647ed1e8aeb9c43ad77eeb98f5..96199b85116d7d06acb756c48bdee045bd28c8d0 100755 (executable)
@@ -8,7 +8,7 @@
 
 """
 
-import sys, os, time, difflib, argparse
+import sys, os, difflib, argparse
 from datetime import datetime, timezone
 
 def file_mtime(path):