mirror of
https://github.com/yt-dlp/yt-dlp
synced 2024-12-26 21:59:08 +01:00
[utils] Popen.run
: Fix default return in binary mode
This commit is contained in:
parent
ab029d7e92
commit
914491b8e0
1 changed files with 2 additions and 1 deletions
|
@ -891,8 +891,9 @@ class Popen(subprocess.Popen):
|
|||
@classmethod
|
||||
def run(cls, *args, timeout=None, **kwargs):
|
||||
with cls(*args, **kwargs) as proc:
|
||||
default = '' if proc.text_mode else b''
|
||||
stdout, stderr = proc.communicate_or_kill(timeout=timeout)
|
||||
return stdout or '', stderr or '', proc.returncode
|
||||
return stdout or default, stderr or default, proc.returncode
|
||||
|
||||
|
||||
def get_subprocess_encoding():
|
||||
|
|
Loading…
Reference in a new issue