Skip to content

Commit c8ea776

Browse files
committed
remove unused import
Signed-off-by: Osama Abdelkader <[email protected]>
1 parent 53f63b9 commit c8ea776

File tree

1 file changed

+6
-7
lines changed

1 file changed

+6
-7
lines changed

Lib/test/test_xml_etree.py

Lines changed: 6 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -698,13 +698,13 @@ def test_iterparse(self):
698698
'junk after document element: line 1, column 12')
699699
with self.assertWarns(ResourceWarning):
700700
del cm, it
701-
support.gc_collect()
701+
gc_collect()
702702

703703
# Deleting iterator without close() should emit ResourceWarning (bpo-43292)
704704
with self.assertWarns(ResourceWarning):
705705
it = iterparse(SIMPLE_XMLFILE)
706706
del it
707-
support.gc_collect()
707+
gc_collect()
708708

709709
# Explicitly calling close() should not emit warning
710710
with warnings_helper.check_no_resource_warning(self):
@@ -718,7 +718,7 @@ def test_iterparse(self):
718718
action, elem = next(it)
719719
self.assertEqual((action, elem.tag), ('end', 'element'))
720720
del it, elem
721-
support.gc_collect()
721+
gc_collect()
722722

723723
with warnings_helper.check_no_resource_warning(self):
724724
it = iterparse(SIMPLE_XMLFILE)
@@ -732,7 +732,6 @@ def test_iterparse(self):
732732

733733
def test_iterparse_resource_warning(self):
734734
# Test ResourceWarning when iterparse with filename is not closed
735-
import gc
736735
import warnings
737736

738737
# Should emit warning when not closed
@@ -745,7 +744,7 @@ def create_unclosed():
745744
# Don't close - should warn
746745

747746
create_unclosed()
748-
support.gc_collect()
747+
gc_collect()
749748

750749
resource_warnings = [x for x in w
751750
if issubclass(x.category, ResourceWarning)]
@@ -762,7 +761,7 @@ def create_closed():
762761
context.close()
763762

764763
create_closed()
765-
support.gc_collect()
764+
gc_collect()
766765

767766
resource_warnings = [x for x in w
768767
if issubclass(x.category, ResourceWarning)]
@@ -780,7 +779,7 @@ def create_with_fileobj():
780779
# Don't close - file object managed externally
781780

782781
create_with_fileobj()
783-
support.gc_collect()
782+
gc_collect()
784783

785784
resource_warnings = [x for x in w
786785
if issubclass(x.category, ResourceWarning)]

0 commit comments

Comments
 (0)