Skip to content

A feature-rich command-line audio/video downloader

[compat] Simplify kwarg detection code

Philipp Hagemeisterc6973bd4124b
diff --git a/youtube_dl/compat.py b/youtube_dl/compat.py
index f4a85443ed..46d4388467 100644
--- a/youtube_dl/compat.py
+++ b/youtube_dl/compat.py
@@ -297,7 +297,9 @@ else:
# Old 2.6 and 2.7 releases require kwargs to be bytes
try:
- (lambda x: x)(**{'x': 0})
+ def _testfunc(x):
+ pass
+ _testfunc(**{'x': 0})
except TypeError:
def compat_kwargs(kwargs):
return dict((bytes(k), v) for k, v in kwargs.items())