projects
/
youtube-dl
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
[downloader/f4m] The last value in a tag is the tag length
[youtube-dl]
/
youtube_dl
/
compat.py
diff --git
a/youtube_dl/compat.py
b/youtube_dl/compat.py
index 2983501aeb44feecf1bd335d5782f455a52f4edb..46d438846787e9a95ea8631c869f96341d4ccb9c 100644
(file)
--- 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')
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:
return path
else:
try:
@@
-270,7
+270,7
@@
if sys.version_info < (3, 0):
print(s.encode(preferredencoding(), 'xmlcharrefreplace'))
else:
def compat_print(s):
print(s.encode(preferredencoding(), 'xmlcharrefreplace'))
else:
def compat_print(s):
- assert
type(s) == type(u''
)
+ assert
isinstance(s, compat_str
)
print(s)
print(s)
@@
-297,7
+297,9
@@
else:
# Old 2.6 and 2.7 releases require kwargs to be bytes
try:
# 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())
except TypeError:
def compat_kwargs(kwargs):
return dict((bytes(k), v) for k, v in kwargs.items())