mirror of
https://github.com/yt-dlp/yt-dlp
synced 2024-12-27 21:59:17 +01:00
[utils/_windows_write_string] Be defensive about fileno (Fixes #2820)
This commit is contained in:
parent
acd69589a5
commit
a383a98af6
1 changed files with 5 additions and 1 deletions
|
@ -926,7 +926,11 @@ def _windows_write_string(s, out):
|
||||||
2: -12,
|
2: -12,
|
||||||
}
|
}
|
||||||
|
|
||||||
fileno = out.fileno()
|
try:
|
||||||
|
fileno = out.fileno()
|
||||||
|
except AttributeError:
|
||||||
|
# If the output stream doesn't have a fileno, it's virtual
|
||||||
|
return False
|
||||||
if fileno not in WIN_OUTPUT_IDS:
|
if fileno not in WIN_OUTPUT_IDS:
|
||||||
return False
|
return False
|
||||||
|
|
||||||
|
|
Loading…
Reference in a new issue