Created
September 17, 2013 02:40
-
-
Save seiichi/6589458 to your computer and use it in GitHub Desktop.
handling subprocess.DEVNULL under both python2 and python3 (taken from youtube-dl)
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
try: | |
from subprocess import DEVNULL | |
compat_subprocess_get_DEVNULL = lambda: DEVNULL | |
except ImportError: | |
compat_subprocess_get_DEVNULL = lambda: open(os.path.devnull, 'w') |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment