X-Git-Url: http://git.cielonegro.org/gitweb.cgi?a=blobdiff_plain;f=youtube_dl%2Fcompat.py;h=46d438846787e9a95ea8631c869f96341d4ccb9c;hb=d6a8160902c2f316b3772648d6eec6bfcb095471;hp=2983501aeb44feecf1bd335d5782f455a52f4edb;hpb=9e1a5b845586a0a5431fb72467142046d8571e6f;p=youtube-dl.git diff --git a/youtube_dl/compat.py b/youtube_dl/compat.py index 2983501ae..46d438846 100644 --- a/youtube_dl/compat.py +++ b/youtube_dl/compat.py @@ -247,7 +247,7 @@ else: userhome = compat_getenv('HOME') elif 'USERPROFILE' in os.environ: userhome = compat_getenv('USERPROFILE') - elif not 'HOMEPATH' in os.environ: + elif 'HOMEPATH' not in os.environ: return path else: try: @@ -270,7 +270,7 @@ if sys.version_info < (3, 0): print(s.encode(preferredencoding(), 'xmlcharrefreplace')) else: def compat_print(s): - assert type(s) == type(u'') + assert isinstance(s, compat_str) print(s) @@ -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())