From 43c6fe1b6c14b7494e1c73ef57b61ae8c11f956a Mon Sep 17 00:00:00 2001 From: Oleg Broytman Date: Sat, 1 Nov 2003 14:39:24 +0000 Subject: [PATCH] Do not barf at int(None). git-svn-id: file:///home/phd/archive/SVN/bookmarks_db/trunk@22 fdd5c36f-1aea-0310-aeeb-c58d7e2b6c23 --- sort_db.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/sort_db.py b/sort_db.py index 60e3d41..3e4399c 100755 --- a/sort_db.py +++ b/sort_db.py @@ -23,12 +23,12 @@ class SortBy: def __call__(self, o1, o2): try: attr1 = int(getattr(o1, self.sort_by)) - except (TypeError, AttributeError): + except (AttributeError, TypeError, ValueError): return 1 try: attr2 = int(getattr(o2, self.sort_by)) - except (TypeError, AttributeError): + except (AttributeError, TypeError, ValueError): return -1 return cmp(attr1, attr2) -- 2.39.5