aboutsummaryrefslogtreecommitdiff
path: root/youtube_dl/utils.py
diff options
context:
space:
mode:
authorSergey M․ <dstftw@gmail.com>2019-03-23 01:08:54 +0700
committerSergey M․ <dstftw@gmail.com>2019-03-23 01:08:54 +0700
commit5e1271c56dbf3f96fbf928ccd3facf5fc70493b4 (patch)
tree739bb713f329e5f28a475b1dfca459d80881c453 /youtube_dl/utils.py
parent050afa60c6685f0b0aff68d943d48b3b6b9c85a0 (diff)
[utils] Improve int_or_none and float_or_none (#20403)
Diffstat (limited to 'youtube_dl/utils.py')
-rw-r--r--youtube_dl/utils.py4
1 files changed, 2 insertions, 2 deletions
diff --git a/youtube_dl/utils.py b/youtube_dl/utils.py
index f2726a579..71713f63a 100644
--- a/youtube_dl/utils.py
+++ b/youtube_dl/utils.py
@@ -1922,7 +1922,7 @@ def int_or_none(v, scale=1, default=None, get_attr=None, invscale=1):
return default
try:
return int(v) * invscale // scale
- except ValueError:
+ except (ValueError, TypeError):
return default
@@ -1943,7 +1943,7 @@ def float_or_none(v, scale=1, invscale=1, default=None):
return default
try:
return float(v) * invscale / scale
- except ValueError:
+ except (ValueError, TypeError):
return default