[Python-checkins] cpython (merge 3.3 -> default): Fix ResourceWarnings in test_sax
antoine.pitrou
python-checkins at python.org
Mon May 13 22:35:48 CEST 2013
http://hg.python.org/cpython/rev/13cae79b155d
changeset: 83766:13cae79b155d
parent: 83764:2368f6f9963f
parent: 83765:6481f819e6f0
user: Antoine Pitrou <solipsis at pitrou.net>
date: Mon May 13 22:35:38 2013 +0200
summary:
Fix ResourceWarnings in test_sax
files:
Lib/test/test_sax.py | 5 ++++-
1 files changed, 4 insertions(+), 1 deletions(-)
diff --git a/Lib/test/test_sax.py b/Lib/test/test_sax.py
--- a/Lib/test/test_sax.py
+++ b/Lib/test/test_sax.py
@@ -574,7 +574,10 @@
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
--
Repository URL: http://hg.python.org/cpython
More information about the Python-checkins
mailing list