From 6f687fa071bce424cae702f44f8dc550bccbc1da Mon Sep 17 00:00:00 2001 From: Tim Savannah Date: Wed, 4 Jan 2017 17:03:46 -0500 Subject: [PATCH] Use os.devnull instead of hardcoding /dev/null which makes this windows compatible --- func_timeout/StoppableThread.py | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/func_timeout/StoppableThread.py b/func_timeout/StoppableThread.py index 37a87d8..d829c45 100644 --- a/func_timeout/StoppableThread.py +++ b/func_timeout/StoppableThread.py @@ -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