mirror of
https://github.com/python/cpython.git
synced 2025-11-25 04:34:37 +00:00
Use os.devnull instead of hardcoded '/dev/null'.
This commit is contained in:
commit
5fd174a78d
4 changed files with 12 additions and 12 deletions
|
|
@ -186,9 +186,9 @@ class CgiTests(unittest.TestCase):
|
|||
cgi.initlog("%s", "Testing initlog 1")
|
||||
cgi.log("%s", "Testing log 2")
|
||||
self.assertEqual(cgi.logfp.getvalue(), "Testing initlog 1\nTesting log 2\n")
|
||||
if os.path.exists("/dev/null"):
|
||||
if os.path.exists(os.devnull):
|
||||
cgi.logfp = None
|
||||
cgi.logfile = "/dev/null"
|
||||
cgi.logfile = os.devnull
|
||||
cgi.initlog("%s", "Testing log 3")
|
||||
self.addCleanup(cgi.closelog)
|
||||
cgi.log("Testing log 4")
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue