1
0
mirror of https://github.com/l1ving/youtube-dl synced 2024-11-20 17:52:51 +08:00

[utils] Add strip_or_none

This commit is contained in:
Sergey M․ 2016-06-25 22:32:02 +07:00
parent 46f59e89ea
commit b72b44318c
No known key found for this signature in database
GPG Key ID: 2C393E0F18A9236D

View File

@ -1660,6 +1660,10 @@ def float_or_none(v, scale=1, invscale=1, default=None):
return default
def strip_or_none(v):
return None if v is None else v.strip()
def parse_duration(s):
if not isinstance(s, compat_basestring):
return None