mirror of
https://github.com/python/cpython.git
synced 2025-08-04 00:48:58 +00:00
Add cgi.closelog() function to close the log file
This commit is contained in:
parent
f64f9e9ec1
commit
d33344a030
3 changed files with 13 additions and 8 deletions
|
@ -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):
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue