Remove unused imports in test modules.
diff --git a/Lib/test/test_descr.py b/Lib/test/test_descr.py
index b0366bd..8ec03087 100644
--- a/Lib/test/test_descr.py
+++ b/Lib/test/test_descr.py
@@ -261,7 +261,6 @@
pass
else:
self.fail("NotImplemented should have caused TypeError")
- import sys
try:
C(sys.maxint+1)
except OverflowError:
@@ -654,7 +653,6 @@
def test_module_subclasses(self):
# Testing Python subclass of module...
log = []
- import types, sys
MT = type(sys)
class MM(MT):
def __init__(self, name):
@@ -1131,7 +1129,6 @@
# Test cyclical leaks [SF bug 519621]
class F(object):
__slots__ = ['a', 'b']
- log = []
s = F()
s.a = [Counted(), s]
self.assertEqual(Counted.counter, 1)
@@ -1140,7 +1137,7 @@
self.assertEqual(Counted.counter, 0)
# Test lookup leaks [SF bug 572567]
- import sys,gc
+ import gc
if hasattr(gc, 'get_objects'):
class G(object):
def __cmp__(self, other):
@@ -1945,7 +1942,6 @@
return 'EPS'
return self
# sys.stdout needs to be the original to trigger the recursion bug
- import sys
test_stdout = sys.stdout
sys.stdout = test_support.get_original_stdout()
try:
@@ -2309,7 +2305,6 @@
self.assertIn('im_self', dir(a.Amethod))
# Try a module subclass.
- import sys
class M(type(sys)):
pass
minstance = M("m")
@@ -3506,7 +3501,6 @@
self.fail("d.foo should be undefined now")
# Test a nasty bug in recurse_down_subclasses()
- import gc
class A(object):
pass
class B(A):
@@ -4327,7 +4321,6 @@
def test_file_fault(self):
# Testing sys.stdout is changed in getattr...
- import sys
test_stdout = sys.stdout
class StdoutGuard:
def __getattr__(self, attr):
@@ -4416,8 +4409,6 @@
def test_not_implemented(self):
# Testing NotImplemented...
# all binary methods should be able to return a NotImplemented
- import sys
- import types
import operator
def specialmethod(self, other):