[utils] Return default on fail in int_or_none

pull/7190/head
Sergey M․ 2015-10-14 22:37:03 +06:00
parent caf80631f0
commit af98f8ff37
1 changed files with 1 additions and 1 deletions

View File

@ -1376,7 +1376,7 @@ def int_or_none(v, scale=1, default=None, get_attr=None, invscale=1):
try: try:
return int(v) * invscale // scale return int(v) * invscale // scale
except ValueError: except ValueError:
pass return default
def str_or_none(v, default=None): def str_or_none(v, default=None):