summaryrefslogtreecommitdiff
path: root/Lib/test/test_cgi.py
diff options
context:
space:
mode:
authorVictor Stinner <victor.stinner@haypocalc.com>2011-07-14 22:28:36 +0200
committerVictor Stinner <victor.stinner@haypocalc.com>2011-07-14 22:28:36 +0200
commitd33344a030bececd68ce487445cd47a11ebdb3fd (patch)
tree3ac312566143f86c4b678863f44358af1127a8f7 /Lib/test/test_cgi.py
parentf64f9e9ec1f8f39dd8c889368ecaad0e198efcb6 (diff)
downloadcpython-git-d33344a030bececd68ce487445cd47a11ebdb3fd.tar.gz
Add cgi.closelog() function to close the log file
Diffstat (limited to 'Lib/test/test_cgi.py')
-rw-r--r--Lib/test/test_cgi.py8
1 files changed, 1 insertions, 7 deletions
diff --git a/Lib/test/test_cgi.py b/Lib/test/test_cgi.py
index c42db4e70d..dba77276d2 100644
--- a/Lib/test/test_cgi.py
+++ b/Lib/test/test_cgi.py
@@ -155,13 +155,7 @@ class CgiTests(unittest.TestCase):
cgi.logfp = None
cgi.logfile = "/dev/null"
cgi.initlog("%s", "Testing log 3")
- 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)
+ self.addCleanup(cgi.closelog)
cgi.log("Testing log 4")
def test_fieldstorage_readline(self):