Make also minor PEP8 coding style fixes on modified imports.
# find this format documented anywhere.
-import locale, copy, io, os, re, struct, sys
+import copy
+import locale
+import os
+import re
+import struct
+import sys
from errno import ENOENT
import os
import sys
-from tkinter.font import Font, nametofont
+from tkinter.font import Font
class InvalidConfigType(Exception): pass
class InvalidConfigSet(Exception): pass
from idlelib import query
from idlelib import replace
from idlelib import search
-from idlelib import textview
from idlelib import windows
# The default tab setting for a Text widget, in average-width characters.
Much is tested by opening config dialog live or in test_configdialog.
Coverage: 27%
'''
-from sys import modules
from test.support import captured_stderr
-from tkinter import Tk
import unittest
from idlelib import config
from test.support import requires
requires('gui')
import unittest
-from tkinter import Tk, Text
+from tkinter import Tk
class GetKeysTest(unittest.TestCase):
import unittest
-from tkinter import Tk, Text
from idlelib.editor import EditorWindow
-from test.support import requires
class Editor_func_test(unittest.TestCase):
def test_filename_to_unicode(self):
'''
import unittest
from test.support import requires
-from tkinter import Tk, Toplevel, Frame ##, BooleanVar, StringVar
+from tkinter import Tk, Frame ##, BooleanVar, StringVar
from idlelib import searchengine as se
from idlelib import searchbase as sdb
from idlelib.idle_test.mock_idle import Func
from code import InteractiveInterpreter
import getopt
-import io
import linecache
import os
import os.path
import os
from sys import executable, platform # Platform is set for one test.
-from tkinter import Toplevel, StringVar, W, E, N, S
+from tkinter import Toplevel, StringVar, W, E, S
from tkinter.ttk import Frame, Button, Entry, Label
from tkinter import filedialog
from tkinter.font import Font
import pickle
# Local imports
-from . import token, tokenize
+from . import token
class Grammar(object):
# Licensed to PSF under a Contributor Agreement.
#
-from abc import ABCMeta, abstractmethod
+from abc import ABCMeta
import copyreg
import functools
import io
import re
import sys
from collections import Sequence
-from contextlib import contextmanager
from errno import EINVAL, ENOENT, ENOTDIR
from operator import attrgetter
from stat import S_ISDIR, S_ISLNK, S_ISREG, S_ISSOCK, S_ISBLK, S_ISCHR, S_ISFIFO
]
import collections
-import decimal
import math
import numbers
from fractions import Fraction
from decimal import Decimal
-from itertools import groupby, chain
+from itertools import groupby
from bisect import bisect_left, bisect_right
import sys
import ssl
import pprint
-import socket
import urllib.parse
# Rename HTTPServer to _HTTPServer so as to avoid confusion with HTTPSServer.
from http.server import (HTTPServer as _HTTPServer,
"""Unit tests for abc.py."""
import unittest
-from test import support
import abc
from inspect import isabstract
import types
import unittest
-from unittest import mock
-
from test.support import import_module
asyncio = import_module("asyncio")
"""Tests support for new syntax introduced by PEP 492."""
-import collections.abc
import types
import unittest
"""Tests for binary operators on subtypes of built-in types."""
import unittest
-from test import support
from operator import eq, le, ne
from abc import ABCMeta
import unittest
import warnings
from operator import neg
-from test.support import TESTFN, unlink, run_unittest, check_warnings
+from test.support import TESTFN, unlink, check_warnings
from test.support.script_helper import assert_python_ok
try:
import pty, signal
import collections
import copy
import doctest
-import inspect
import keyword
import operator
import pickle
import locale
from test.support import (run_unittest, run_doctest, is_resource_enabled,
requires_IEEE_754, requires_docstrings)
-from test.support import (check_warnings, import_fresh_module, TestFailed,
+from test.support import (import_fresh_module, TestFailed,
run_with_locale, cpython_only)
import random
import inspect
@run_with_locale('LC_ALL', 'ps_AF')
def test_wide_char_separator_decimal_point(self):
# locale with wide char separator and decimal point
- import locale
Decimal = self.decimal.Decimal
decimal_point = locale.localeconv()['decimal_point']
import weakref
import copy
import pickle
-from io import StringIO
import random
import struct
import warnings
import weakref
import inspect
-import types
from test import support
# Simple test suite for http/cookies.py
import copy
-from test.support import run_unittest, run_doctest, check_warnings
+from test.support import run_unittest, run_doctest
import unittest
from http import cookies
import pickle
-import warnings
+
class CookieTests(unittest.TestCase):
import socketserver
import time
import calendar
-import inspect
from test.support import (reap_threads, verbose, transient_internet,
run_with_tz, run_with_locale)
import decimal
-from io import StringIO, BytesIO
+from io import StringIO
from collections import OrderedDict
from test.test_json import PyTest, CTest
import os
import sys
-import builtins
import contextlib
import importlib.util
import inspect
-from test.support import verbose, run_unittest, gc_collect, bigmemtest, _2G, \
- cpython_only, captured_stdout
+from test.support import (gc_collect, bigmemtest, _2G,
+ cpython_only, captured_stdout)
import locale
import re
import sre_compile
import errno
import functools
import subprocess
-from contextlib import ExitStack
from shutil import (make_archive,
register_archive_format, unregister_archive_format,
get_archive_formats, Error, unpack_archive,
import zipfile
from test import support
-from test.support import (TESTFN, check_warnings, captured_stdout,
- android_not_root)
+from test.support import TESTFN, android_not_root
TESTFN2 = TESTFN + "2"
-import unittest
-from test import support
-from contextlib import closing
-import select
+import os
import signal
import socket
-import struct
import subprocess
-import sys, os, time, errno
+import sys
+import time
+import unittest
+from test import support
from test.support.script_helper import assert_python_ok, spawn_python
try:
import threading
import codecs
import gc
import sysconfig
-import platform
import locale
# count the number of test runs, used to create unique
import itertools
import operator
import struct
-import string
import sys
import unittest
import warnings
from test.support import script_helper
from test.support import (TESTFN, findfile, unlink, rmtree, temp_dir, temp_cwd,
requires_zlib, requires_bz2, requires_lzma,
- captured_stdout, check_warnings)
+ captured_stdout)
TESTFN2 = TESTFN + "2"
TESTFNDIR = TESTFN + "d"
import time
import sys
-from io import StringIO
from tempfile import TemporaryFile
from test.support import TESTFN, requires_zlib
__unittest = True
-from .main import main, TestProgram
+from .main import main
main(module=None)
import time
-from math import log, ceil
try:
from test.support import import_fresh_module
except ImportError:
from __future__ import print_function
import os
-import re
import sys
import subprocess
from shutil import copy
import abc
import ast
-import atexit
import collections
import contextlib
import copy
import textwrap
import traceback
import types
-import uuid
from types import *
NoneType = type(None)
from itertools import chain
from pathlib import Path
from zipfile import ZipFile, ZIP_DEFLATED
-import subprocess
+
TKTCL_RE = re.compile(r'^(_?tk|tcl).+\.(pyd|dll)', re.IGNORECASE)
DEBUG_RE = re.compile(r'_d\.(pyd|dll|exe|pdb|lib)$', re.IGNORECASE)
import struct
from array import array
from collections import namedtuple
-from datetime import datetime, timedelta
+from datetime import datetime
ttinfo = namedtuple('ttinfo', ['tt_gmtoff', 'tt_isdst', 'tt_abbrind'])