Commit 1e8ee9b3 authored by Berker Peksag's avatar Berker Peksag

Issue #23277: Remove unused sys and os imports

Patch by Jon Dufresne.
parent 37917369
......@@ -54,7 +54,7 @@ of 'x' ('_b_base_' is either None, or the root object owning the memory block):
'''
import unittest, doctest, sys
import unittest, doctest
import ctypes.test.test_objects
......
import unittest, sys
import unittest
from ctypes.test import need_symbol
class SimpleTypesTestCase(unittest.TestCase):
......
import unittest
from ctypes import *
import os
import _ctypes_test
......
......@@ -2,7 +2,6 @@
from ctypes import *
import sys
import unittest
......
......@@ -3,7 +3,7 @@ import unittest
import array
import io
import pickle
import sys
class UnseekableIO(io.FileIO):
def tell(self):
......
......@@ -3,7 +3,6 @@ and friends."""
import os
import shutil
import sys
import tempfile
from subprocess import *
......
......@@ -2,7 +2,6 @@ from test.support import findfile, TESTFN, unlink
import unittest
from test import audiotests
from audioop import byteswap
import os
import io
import sys
import struct
......
......@@ -4,7 +4,6 @@
Based on an original test by Roger E. Masse.
"""
import binhex
import os
import unittest
from test import support
......
......@@ -4,7 +4,6 @@
import copy
import io
import sys
import os
import unittest
from io import StringIO
from tempfile import TemporaryFile
......
"""Test script for the dbm.open function based on testdumbdbm.py"""
import os
import unittest
import glob
import test.support
......
from test import support
support.import_module("dbm.ndbm") #skip if not supported
import unittest
import os
import random
import dbm.ndbm
from dbm.ndbm import error
......
......@@ -5,7 +5,6 @@
import os
import random
import select
import sys
import unittest
from test.support import TESTFN, run_unittest, cpython_only
......
import os
import signal
import subprocess
import sys
import unittest
from test import support
......
import os
import sys
import unittest
import collections
import email
......
"""Unittests for heapq."""
import sys
import random
import unittest
......
from importlib import _bootstrap_external
import sys
from test import support
import unittest
......
......@@ -3,7 +3,6 @@ from .. import util
machinery = util.import_importlib('importlib.machinery')
import collections
import sys
import unittest
......
......@@ -3,8 +3,6 @@ from .. import util
machinery = util.import_importlib('importlib.machinery')
import sys
from test.support import captured_stdout
import types
import unittest
......
"""Test relative imports (PEP 328)."""
from .. import util
import sys
import unittest
import warnings
......
......@@ -5,7 +5,6 @@ importlib = util.import_importlib('importlib')
machinery = util.import_importlib('importlib.machinery')
import os
import sys
from test import support as test_support
import unittest
......
import os
import sys
import json
import doctest
import unittest
......
......@@ -5,7 +5,6 @@ import errno
import os
import select
import socket
import sys
import time
import unittest
......
""" Test suite for the code in msilib """
import unittest
import os
from test.support import import_module
msilib = import_module('msilib')
......
......@@ -5,7 +5,7 @@
from test import support
from test.support import TESTFN
import unittest, io, codecs, sys, os
import unittest, io, codecs, sys
import _multibytecodec
ALL_CJKENCODINGS = [
......
from test import support
import unittest
import sys
# Skip test if nis module does not exist.
nis = support.import_module('nis')
......
......@@ -3,7 +3,6 @@ import unittest
from http.client import HTTPException
import sys
import os
from unicodedata import normalize, unidata_version
TESTDATAFILE = "NormalizationTest.txt"
......
import parser
import unittest
import sys
import operator
import struct
from test import support
......
......@@ -2,7 +2,6 @@ import builtins
import os
import select
import socket
import sys
import unittest
import errno
from errno import EEXIST
......
import itertools
import os
import posixpath
import sys
import unittest
import warnings
from posixpath import realpath, abspath, dirname, basename
......
import io
import unittest
import sys
import xml.sax
from xml.sax.xmlreader import AttributesImpl
......
import unittest
import sys, os, io, subprocess
import sys, io, subprocess
import quopri
......
from test import support
import random
import sys
import unittest
from functools import cmp_to_key
......
......@@ -5,7 +5,6 @@ import time
import locale
import re
import os
import sys
from test import support
from datetime import date as datetime_date
......
"""Tests for the md5sum script in the Tools directory."""
import os
import sys
import unittest
from test import support
from test.support.script_helper import assert_python_ok, assert_python_failure
......
"""Tests for the pdeps script in the Tools directory."""
import os
import sys
import unittest
import tempfile
from test import support
......
import os
import unittest
from test import support
......
import os
from test import support
# Skip this test if _tkinter does not exist.
......
......@@ -352,7 +352,6 @@ Some size constraints (all fail.)
__test__ = {'doctests' : doctests}
def test_main(verbose=False):
import sys
from test import support
from test import test_unpack_ex
support.run_doctest(test_unpack_ex, verbose)
......
......@@ -4,7 +4,6 @@ from test import support
import contextlib
import socket
import urllib.request
import sys
import os
import email.message
import time
......
......@@ -3,9 +3,7 @@ from weakref import proxy, ref, WeakSet
import operator
import copy
import string
import os
from random import randrange, shuffle
import sys
import warnings
import collections
from collections import UserString as ustr
......
# xml.etree test for cElementTree
import sys, struct
import struct
from test import support
from test.support import import_fresh_module
import types
......
import collections.abc
import errno
import socket
import sys
import unittest
from test import support
......
import contextlib
import io
import os
import sys
import importlib.util
import posixpath
import time
......
......@@ -7,7 +7,6 @@ Extensions also should live in packages following the same rule as above.
"""
import os
import sys
import unittest
import importlib
import test.support
......
import sys
def is_instance(obj, klass):
"""Version of is_instance that doesn't access __class__"""
return issubclass(type(obj), klass)
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment