projects
/
youtube-dl
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
| inline |
side by side
(parent:
61bbddb
)
[utils] Add None check in str_to_int
author
Sergey M․
<dstftw@gmail.com>
Fri, 18 Jul 2014 14:37:40 +0000
(21:37 +0700)
committer
Sergey M․
<dstftw@gmail.com>
Fri, 18 Jul 2014 14:37:40 +0000
(21:37 +0700)
youtube_dl/utils.py
patch
|
blob
|
history
diff --git
a/youtube_dl/utils.py
b/youtube_dl/utils.py
index 64a9618ca62493f893af16b31b3fbd331bbdc1e7..919603c623ed8cd809745c1314442adabf4567c8 100644
(file)
--- a/
youtube_dl/utils.py
+++ b/
youtube_dl/utils.py
@@
-1194,6
+1194,8
@@
def format_bytes(bytes):
def str_to_int(int_str):
+ if int_str is None:
+ return None
int_str = re.sub(r'[,\.]', u'', int_str)
return int(int_str)