From: Sergey M․ Date: Wed, 14 Oct 2015 16:37:03 +0000 (+0600) Subject: [utils] Return default on fail in int_or_none X-Git-Url: http://git.oshgnacknak.de/?a=commitdiff_plain;h=af98f8ff37b3a0d9d1f743f4fc6c646333501eb6;p=youtube-dl [utils] Return default on fail in int_or_none --- diff --git a/youtube_dl/utils.py b/youtube_dl/utils.py index 83b44caaa..7dbe25661 100644 --- a/youtube_dl/utils.py +++ b/youtube_dl/utils.py @@ -1376,7 +1376,7 @@ def int_or_none(v, scale=1, default=None, get_attr=None, invscale=1): try: return int(v) * invscale // scale except ValueError: - pass + return default def str_or_none(v, default=None):