diff --git a/Lib/test/test_cgi.py b/Lib/test/test_cgi.py --- a/Lib/test/test_cgi.py +++ b/Lib/test/test_cgi.py @@ -156,6 +156,12 @@ cgi.logfile = "/dev/null" cgi.initlog("%s", "Testing log 3") cgi.log("Testing log 4") + # suppress ResourceWarning in regrtest; leave cgi.log* in a + # consistent state in case another test wants to use it + cgi.logfp.close() + cgi.logfile = "" + cgi.logfp = None + cgi.log = cgi.initlog def test_fieldstorage_readline(self): # FieldStorage uses readline, which has the capacity to read all