aboutsummaryrefslogtreecommitdiffstats
path: root/yt_dlp/utils.py
diff options
context:
space:
mode:
authorpukkandan <pukkandan.ytdlp@gmail.com>2022-09-17 11:57:47 +0530
committerpukkandan <pukkandan.ytdlp@gmail.com>2022-09-17 11:57:47 +0530
commitdab284f80fb08675008eec39a4561fed1cf1617b (patch)
tree96cd6d111a4ab78d78153acefe776d222c0699ab /yt_dlp/utils.py
parent9665f15a960c4e274b0be5fbf22e6f4a6680d162 (diff)
downloadhypervideo-pre-dab284f80fb08675008eec39a4561fed1cf1617b.tar.lz
hypervideo-pre-dab284f80fb08675008eec39a4561fed1cf1617b.tar.xz
hypervideo-pre-dab284f80fb08675008eec39a4561fed1cf1617b.zip
Workaround `libc_ver` not be available on Windows Store version of Python
Diffstat (limited to 'yt_dlp/utils.py')
-rw-r--r--yt_dlp/utils.py5
1 files changed, 4 insertions, 1 deletions
diff --git a/yt_dlp/utils.py b/yt_dlp/utils.py
index f6f7c38d1..443c49814 100644
--- a/yt_dlp/utils.py
+++ b/yt_dlp/utils.py
@@ -1966,13 +1966,16 @@ def system_identifier():
python_implementation = platform.python_implementation()
if python_implementation == 'PyPy' and hasattr(sys, 'pypy_version_info'):
python_implementation += ' version %d.%d.%d' % sys.pypy_version_info[:3]
+ libc_ver = []
+ with contextlib.suppress(OSError): # We may not have access to the executable
+ libc_ver = platform.libc_ver()
return 'Python %s (%s %s) - %s %s' % (
platform.python_version(),
python_implementation,
platform.architecture()[0],
platform.platform(),
- format_field(join_nonempty(*platform.libc_ver(), delim=' '), None, '(%s)'),
+ format_field(join_nonempty(*libc_ver, delim=' '), None, '(%s)'),
)