From d5a43e95c806f99b35a18ef880e7e6bab05b6eb9 Mon Sep 17 00:00:00 2001 From: Victor Stinner Date: Thu, 14 Jul 2011 22:28:36 +0200 Subject: Add cgi.closelog() function to close the log file --- Lib/test/test_cgi.py | 8 +------- 1 file changed, 1 insertion(+), 7 deletions(-) (limited to 'Lib/test/test_cgi.py') 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): -- cgit v1.2.1