Removed unused imports.

This commit is contained in:
Serhiy Storchaka 2016-04-25 00:12:32 +03:00
parent a6f26c1d34
commit ccd047ea4b
26 changed files with 11 additions and 31 deletions

View File

@ -9,7 +9,7 @@ configure-like tasks: "try to compile this C code", or "figure out where
this header file lives". this header file lives".
""" """
import sys, os, re import os, re
from distutils.core import Command from distutils.core import Command
from distutils.errors import DistutilsExecError from distutils.errors import DistutilsExecError

View File

@ -5,7 +5,7 @@ Implements the Distutils 'register' command (register with the repository).
# created 2002/10/21, Richard Jones # created 2002/10/21, Richard Jones
import os, string, getpass import getpass
import io import io
import urllib.parse, urllib.request import urllib.parse, urllib.request
from warnings import warn from warnings import warn

View File

@ -3,7 +3,6 @@
Implements the Distutils 'sdist' command (create a source distribution).""" Implements the Distutils 'sdist' command (create a source distribution)."""
import os import os
import string
import sys import sys
from types import * from types import *
from glob import glob from glob import glob

View File

@ -4,7 +4,6 @@ Provides the Extension class, used to describe C/C++ extension
modules in setup scripts.""" modules in setup scripts."""
import os import os
import sys
import warnings import warnings
# This class is really only used by the "build_ext" command, so it might # This class is really only used by the "build_ext" command, so it might

View 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 that (optionally) takes care of stripping comments, ignoring blank
lines, and joining lines with backslashes.""" lines, and joining lines with backslashes."""
import sys, os, io import sys, io
class TextFile: class TextFile:

View File

@ -36,10 +36,8 @@ python ftplib.py -d localhost -l -p -l
# Modified by Giampaolo Rodola' to add TLS support. # Modified by Giampaolo Rodola' to add TLS support.
# #
import os
import sys import sys
import socket import socket
import warnings
from socket import _GLOBAL_DEFAULT_TIMEOUT from socket import _GLOBAL_DEFAULT_TIMEOUT
__all__ = ["FTP", "error_reply", "error_temp", "error_perm", "error_proto", __all__ = ["FTP", "error_reply", "error_temp", "error_perm", "error_proto",

View 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. show_idlehelp - Create HelpWindow. Called in EditorWindow.help_dialog.
""" """
from html.parser import HTMLParser from html.parser import HTMLParser
from os.path import abspath, dirname, isdir, isfile, join from os.path import abspath, dirname, isfile, join
from tkinter import Tk, Toplevel, Frame, Text, Scrollbar, Menu, Menubutton from tkinter import Toplevel, Frame, Text, Scrollbar, Menu, Menubutton
from tkinter import font as tkfont from tkinter import font as tkfont
from idlelib.configHandler import idleConf from idlelib.configHandler import idleConf

View File

@ -3,7 +3,6 @@ A number of functions that enhance IDLE on Mac OSX.
""" """
import sys import sys
import tkinter import tkinter
from os import path
import warnings import warnings
def runningAsOSXApp(): def runningAsOSXApp():

View File

@ -1,8 +1,6 @@
"""Utility functions, node construction macros, etc.""" """Utility functions, node construction macros, etc."""
# Author: Collin Winter # Author: Collin Winter
from itertools import islice
# Local imports # Local imports
from .pgen2 import token from .pgen2 import token
from .pytree import Leaf, Node from .pytree import Leaf, Node

View File

@ -30,9 +30,8 @@ as an argument to a function that introspects the argument).
# Local imports # Local imports
from .. import pytree from .. import pytree
from .. import patcomp from .. import patcomp
from ..pgen2 import token
from .. import fixer_base 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 from .. import fixer_util

View File

@ -10,7 +10,6 @@ exec code in ns1, ns2 -> exec(code, ns1, ns2)
""" """
# Local imports # Local imports
from .. import pytree
from .. import fixer_base from .. import fixer_base
from ..fixer_util import Comma, Name, Call from ..fixer_util import Comma, Name, Call

View File

@ -14,7 +14,6 @@ Python 2.6 figure it out.
""" """
# Local imports # Local imports
from ..pgen2 import token
from .. import fixer_base from .. import fixer_base
from ..fixer_util import Name, Call, ListComp, in_special_context from ..fixer_util import Name, Call, ListComp, in_special_context

View File

@ -31,7 +31,6 @@ CAVEATS:
# Local imports # Local imports
from .. import pytree from .. import pytree
from ..pgen2 import token
from .. import fixer_base from .. import fixer_base
from ..fixer_util import Name, parenthesize from ..fixer_util import Name, parenthesize

View File

@ -20,7 +20,7 @@
# Local imports # Local imports
from .. import fixer_base from .. import fixer_base
from ..pygram import token from ..pygram import token
from ..fixer_util import Name, syms, Node, Leaf from ..fixer_util import syms, Node, Leaf
def has_metaclass(parent): def has_metaclass(parent):

View File

@ -3,7 +3,7 @@
# Local imports # Local imports
from .. import fixer_base from .. import fixer_base
from ..fixer_util import Name, syms from ..fixer_util import Name
class FixNonzero(fixer_base.BaseFix): class FixNonzero(fixer_base.BaseFix):
BM_compatible = True BM_compatible = True

View File

@ -18,7 +18,7 @@ from .. import patcomp
from .. import pytree from .. import pytree
from ..pgen2 import token from ..pgen2 import token
from .. import fixer_base 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( parend_expr = patcomp.compile_pattern(

View File

@ -20,7 +20,6 @@ There should be another fixer that handles at least the following constants:
""" """
# Local imports # Local imports
from ..pgen2 import token
from .. import fixer_base from .. import fixer_base
from ..fixer_util import Name from ..fixer_util import Name

View File

@ -6,7 +6,6 @@
# Local imports # Local imports
from lib2to3.fixes.fix_imports import alternates, FixImports from lib2to3.fixes.fix_imports import alternates, FixImports
from lib2to3 import fixer_base
from lib2to3.fixer_util import (Name, Comma, FromImport, Newline, from lib2to3.fixer_util import (Name, Comma, FromImport, Newline,
find_indentation, Node, syms) find_indentation, Node, syms)

View File

@ -26,7 +26,6 @@ from itertools import chain
from .pgen2 import driver, tokenize, token from .pgen2 import driver, tokenize, token
from .fixer_util import find_root from .fixer_util import find_root
from . import pytree, pygram from . import pytree, pygram
from . import btm_utils as bu
from . import btm_matcher as bm from . import btm_matcher as bm

View File

@ -40,12 +40,10 @@ Instances of this class have the following instance variables:
""" """
import io import io
import os
import sys import sys
import importlib.util import importlib.util
import tokenize import tokenize
from token import NAME, DEDENT, OP from token import NAME, DEDENT, OP
from operator import itemgetter
__all__ = ["readmodule", "readmodule_ex", "Class", "Function"] __all__ = ["readmodule", "readmodule_ex", "Class", "Function"]
@ -328,6 +326,7 @@ def _getname(g):
def _main(): def _main():
# Main program for testing. # Main program for testing.
import os import os
from operator import itemgetter
mod = sys.argv[1] mod = sys.argv[1]
if os.path.exists(mod): if os.path.exists(mod):
path = [os.path.dirname(mod)] path = [os.path.dirname(mod)]

View File

@ -119,7 +119,6 @@ This module also defines an exception 'error'.
""" """
import sys
import sre_compile import sre_compile
import sre_parse import sre_parse
try: try:

View File

@ -95,7 +95,6 @@ from idlelib.textView import view_text
from turtledemo import __doc__ as about_turtledemo from turtledemo import __doc__ as about_turtledemo
import turtle import turtle
import time
demo_dir = os.path.dirname(os.path.abspath(__file__)) demo_dir = os.path.dirname(os.path.abspath(__file__))
darwin = sys.platform == 'darwin' darwin = sys.platform == 'darwin'

View File

@ -22,7 +22,6 @@ to 0, this animation runs in "line per line"
mode as fast as possible. mode as fast as possible.
""" """
import math
from turtle import Turtle, mainloop from turtle import Turtle, mainloop
from time import clock from time import clock

View File

@ -18,7 +18,6 @@ mouse over the scrollbar of the canvas.
""" """
from turtle import Shape, Turtle, mainloop, Vec2D as Vec from turtle import Shape, Turtle, mainloop, Vec2D as Vec
from time import sleep
G = 8 G = 8

View File

@ -487,7 +487,6 @@ try:
# Assume that the uuid_generate functions are broken from 10.5 onward, # Assume that the uuid_generate functions are broken from 10.5 onward,
# the test can be adjusted when a later version is fixed. # the test can be adjusted when a later version is fixed.
if sys.platform == 'darwin': if sys.platform == 'darwin':
import os
if int(os.uname().release.split('.')[0]) >= 9: if int(os.uname().release.split('.')[0]) >= 9:
_uuid_generate_time = None _uuid_generate_time = None

View File

@ -8,7 +8,7 @@
""" """
import sys, os, time, difflib, argparse import sys, os, difflib, argparse
from datetime import datetime, timezone from datetime import datetime, timezone
def file_mtime(path): def file_mtime(path):