Commit f30645d5 authored by Brett Cannon's avatar Brett Cannon

Close a stream properly in test.test_pulldom.

Closes issue #11550. Thanks to Ben Hayden for some inspiration on the
solution.
parent 71f1363c
...@@ -32,7 +32,9 @@ class PullDOMTestCase(unittest.TestCase): ...@@ -32,7 +32,9 @@ class PullDOMTestCase(unittest.TestCase):
# fragment. # fragment.
# Test with a filename: # Test with a filename:
list(pulldom.parse(tstfile)) handler = pulldom.parse(tstfile)
self.addCleanup(handler.stream.close)
list(handler)
# Test with a file object: # Test with a file object:
with open(tstfile, "rb") as fin: with open(tstfile, "rb") as fin:
......
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