From: Sergey M․ Date: Mon, 12 Jan 2015 15:06:26 +0000 (+0600) Subject: [utils] Disallow non string types in parse_duration (Closes #4679) X-Git-Url: http://git.oshgnacknak.de/?a=commitdiff_plain;h=227d4822fff13ea449f11531ce54c56b2b01432b;p=youtube-dl [utils] Disallow non string types in parse_duration (Closes #4679) --- diff --git a/youtube_dl/utils.py b/youtube_dl/utils.py index deaf71803..98732e8e9 100644 --- a/youtube_dl/utils.py +++ b/youtube_dl/utils.py @@ -1269,7 +1269,7 @@ def float_or_none(v, scale=1, invscale=1, default=None): def parse_duration(s): - if s is None: + if not isinstance(s, basestring if sys.version_info < (3, 0) else compat_str): return None s = s.strip()