summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorEzio Melotti <ezio.melotti@gmail.com>2011-07-14 12:57:12 (GMT)
committerEzio Melotti <ezio.melotti@gmail.com>2011-07-14 12:57:12 (GMT)
commite73d49d3282bd4d87ddac6599778229f25c69a6b (patch)
tree1145edb9ac179ca3703cc7b196f5f6a6145d13fa
parentd77e2eaa4026af658dab927a39385f1ef361ec5f (diff)
parent7ebb7061339f242b9ffd9fd8a7ad1f172d341666 (diff)
downloadcpython-e73d49d3282bd4d87ddac6599778229f25c69a6b.zip
cpython-e73d49d3282bd4d87ddac6599778229f25c69a6b.tar.gz
cpython-e73d49d3282bd4d87ddac6599778229f25c69a6b.tar.bz2
Merge with 3.2.
-rw-r--r--Lib/test/test_cgi.py8
1 files changed, 7 insertions, 1 deletions
diff --git a/Lib/test/test_cgi.py b/Lib/test/test_cgi.py
index d745199..c42db4e 100644
--- a/Lib/test/test_cgi.py
+++ b/Lib/test/test_cgi.py
@@ -155,7 +155,13 @@ class CgiTests(unittest.TestCase):
cgi.logfp = None
cgi.logfile = "/dev/null"
cgi.initlog("%s", "Testing log 3")
- self.addCleanup(cgi.logfp.close)
+ def log_cleanup():
+ """Restore the global state of the log vars."""
+ cgi.logfile = ''
+ cgi.logfp.close()
+ cgi.logfp = None
+ cgi.log = cgi.initlog
+ self.addCleanup(log_cleanup)
cgi.log("Testing log 4")
def test_fieldstorage_readline(self):