Use os.devnull instead of hardcoding /dev/null which makes this windows compatible

This commit is contained in:
Tim Savannah 2017-01-04 17:03:46 -05:00
parent 9dbefe0ff1
commit 6f687fa071

View File

@ -5,6 +5,7 @@
LICENSE, otherwise it is available at https://github.com/kata198/func_timeout/LICENSE
'''
import os
import ctypes
import threading
import time
@ -21,7 +22,7 @@ class StoppableThread(threading.Thread):
if self.isAlive() is False:
return True
self._stderr = open('/dev/null', 'w')
self._stderr = open(os.devnull, 'w')
joinThread = JoinThread(self, exception)
joinThread.start()
joinThread._stderr = self._stderr