changeset 3347:055dc1ab768c

safe_int should also catch TypeError
author Marcin Kuzminski <marcin@python-works.com>
date Thu, 24 Jan 2013 01:20:03 +0100
parents 45755867deda
children 6f82f8bdd22c
files rhodecode/lib/utils2.py
diffstat 1 files changed, 1 insertions(+), 1 deletions(-) [+]
line wrap: on
line diff
--- a/rhodecode/lib/utils2.py	Thu Jan 24 12:09:55 2013 +0100
+++ b/rhodecode/lib/utils2.py	Thu Jan 24 01:20:03 2013 +0100
@@ -182,7 +182,7 @@
 
     try:
         val = int(val)
-    except ValueError:
+    except (ValueError, TypeError):
         val = default
 
     return val