X-Git-Url: http://git.bitcoin.ninja/index.cgi?a=blobdiff_plain;ds=sidebyside;f=youtube_dl%2Fcompat.py;h=ace5bd716aac0161b356625260f1138687568314;hb=26c61e080908b20f3c6707789bb42933bbbb42a0;hp=e4b9286c06e12d967f60b5fbcf2c691802684163;hpb=75e8b2ac87e77db5a752317fcf03cef54c1536d0;p=youtube-dl diff --git a/youtube_dl/compat.py b/youtube_dl/compat.py index e4b9286c0..ace5bd716 100644 --- a/youtube_dl/compat.py +++ b/youtube_dl/compat.py @@ -436,6 +436,11 @@ except TypeError: # Python 2.6 yield n n += step +if sys.version_info >= (3, 0): + from tokenize import tokenize as compat_tokenize_tokenize +else: + from tokenize import generate_tokens as compat_tokenize_tokenize + __all__ = [ 'compat_HTTPError', 'compat_basestring', @@ -457,6 +462,7 @@ __all__ = [ 'compat_socket_create_connection', 'compat_str', 'compat_subprocess_get_DEVNULL', + 'compat_tokenize_tokenize', 'compat_urllib_error', 'compat_urllib_parse', 'compat_urllib_parse_unquote',