diff options
author | Sergey M․ <dstftw@gmail.com> | 2015-07-10 20:56:08 +0600 |
---|---|---|
committer | Sergey M․ <dstftw@gmail.com> | 2015-07-10 20:56:08 +0600 |
commit | 008661069b0c33614ebdd7c9bcf838256db1b127 (patch) | |
tree | 5bb5a44e84553a99f70ab33ac40caeb3c88c9995 /youtube_dl/compat.py | |
parent | 9296e92e1cbb5788c18c9a09590ccbc0e3faec68 (diff) | |
parent | 2a01c940ec956b26c5dc18c355b66f719fc46386 (diff) |
Merge branch 'master' of github.com:rg3/youtube-dl
Diffstat (limited to 'youtube_dl/compat.py')
-rw-r--r-- | youtube_dl/compat.py | 11 |
1 files changed, 11 insertions, 0 deletions
diff --git a/youtube_dl/compat.py b/youtube_dl/compat.py index f9529210d..c3783337a 100644 --- a/youtube_dl/compat.py +++ b/youtube_dl/compat.py @@ -9,6 +9,7 @@ import shutil import socket import subprocess import sys +import itertools try: @@ -388,6 +389,15 @@ else: pass return _terminal_size(columns, lines) +try: + itertools.count(start=0, step=1) + compat_itertools_count = itertools.count +except TypeError: # Python 2.6 + def compat_itertools_count(start=0, step=1): + n = start + while True: + yield n + n += step __all__ = [ 'compat_HTTPError', @@ -401,6 +411,7 @@ __all__ = [ 'compat_html_entities', 'compat_http_client', 'compat_http_server', + 'compat_itertools_count', 'compat_kwargs', 'compat_ord', 'compat_parse_qs', |