mirror of
https://github.com/python/cpython.git
synced 2025-08-04 00:48:58 +00:00
Fix ResourceWarnings in test_sax
This commit is contained in:
parent
bf4cba7e8b
commit
2adb6fe246
1 changed files with 4 additions and 1 deletions
|
@ -574,7 +574,10 @@ class StreamReaderWriterXmlgenTest(XmlgenTest, unittest.TestCase):
|
|||
def ioclass(self):
|
||||
writer = codecs.open(self.fname, 'w', encoding='ascii',
|
||||
errors='xmlcharrefreplace', buffering=0)
|
||||
self.addCleanup(support.unlink, self.fname)
|
||||
def cleanup():
|
||||
writer.close()
|
||||
support.unlink(self.fname)
|
||||
self.addCleanup(cleanup)
|
||||
writer.getvalue = self.getvalue
|
||||
return writer
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue