[test/test_execution.py] Use `compat_subprocess_get_DEVNULL()`
authordirkf <fieldhouse@gmx.net>
Thu, 20 Jul 2023 18:32:29 +0000 (19:32 +0100)
committerdirkf <fieldhouse@gmx.net>
Tue, 25 Jul 2023 12:19:43 +0000 (13:19 +0100)
test/test_execution.py

index ae59e562aaa7ca7ab5723e4f21633b7e20173e69..56e1b679d1fffe9294bd19515adb0f7976cc862b 100644 (file)
@@ -10,17 +10,14 @@ import os
 import subprocess
 sys.path.insert(0, os.path.dirname(os.path.dirname(os.path.abspath(__file__))))
 
-from youtube_dl.compat import compat_register_utf8
+from youtube_dl.compat import compat_register_utf8, compat_subprocess_get_DEVNULL
 from youtube_dl.utils import encodeArgument
 
 compat_register_utf8()
 
 rootDir = os.path.dirname(os.path.dirname(os.path.abspath(__file__)))
 
-try:
-    _DEV_NULL = subprocess.DEVNULL
-except AttributeError:
-    _DEV_NULL = open(os.devnull, 'wb')
+_DEV_NULL = compat_subprocess_get_DEVNULL()
 
 
 class TestExecution(unittest.TestCase):