projects
/
youtube-dl
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
| inline |
side by side
[utils] handle int values passed to str_to_int
[youtube-dl]
/
youtube_dl
/
utils.py
diff --git
a/youtube_dl/utils.py
b/youtube_dl/utils.py
index b14603d8ac9e7ade80f8d90254239f814c091bdf..328f037a8aa8313158e543e3c2abf8491ae3d1af 100644
(file)
--- a/
youtube_dl/utils.py
+++ b/
youtube_dl/utils.py
@@
-3519,8
+3519,8
@@
def str_or_none(v, default=None):
def str_to_int(int_str):
""" A more relaxed version of int_or_none """
- if
int_str is None
:
- return
None
+ if
not isinstance(int_str, compat_str)
:
+ return
int_str
int_str = re.sub(r'[,\.\+]', '', int_str)
return int(int_str)