Changed hardcoded devnull path to os.devnull to improve MacOS compatibility.