diff options
author | Sergey M․ <dstftw@gmail.com> | 2019-05-23 23:58:35 +0700 |
---|---|---|
committer | Sergey M․ <dstftw@gmail.com> | 2019-05-24 00:03:01 +0700 |
commit | 53cd37bac50e7a927deba5b67a4412301b96230d (patch) | |
tree | 35edf529fcc856f2f4cc15342b43e06bc65fe475 /youtube_dl | |
parent | f856816b940d95e995c2b9995d01097ab144a1af (diff) |
[utils] Improve strip_or_none
Diffstat (limited to 'youtube_dl')
-rw-r--r-- | youtube_dl/utils.py | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/youtube_dl/utils.py b/youtube_dl/utils.py index 9be9b2e76..ead9bd862 100644 --- a/youtube_dl/utils.py +++ b/youtube_dl/utils.py @@ -1951,8 +1951,8 @@ def bool_or_none(v, default=None): return v if isinstance(v, bool) else default -def strip_or_none(v): - return None if v is None else v.strip() +def strip_or_none(v, default=None): + return v.strip() if isinstance(v, compat_str) else default def url_or_none(url): |