X-Git-Url: http://git.bitcoin.ninja/index.cgi?a=blobdiff_plain;f=youtube_dl%2Fcompat.py;h=ace5bd716aac0161b356625260f1138687568314;hb=c3c9f879541b99a5456991d887ed03a2aea5dcff;hp=e4b9286c06e12d967f60b5fbcf2c691802684163;hpb=799207e838e0404aaa5cb6658e41bef108aced16;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',