Use os.devnull instead of hardcoded '/dev/null'.

This commit is contained in:
Serhiy Storchaka 2015-02-15 14:03:11 +02:00
commit 5fd174a78d
4 changed files with 12 additions and 12 deletions

View file

@ -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")