]> git.phdru.name Git - bookmarks_db.git/commitdiff
Do not barf at int(None).
authorOleg Broytman <phd@phdru.name>
Sat, 1 Nov 2003 14:39:24 +0000 (14:39 +0000)
committerOleg Broytman <phd@phdru.name>
Sat, 1 Nov 2003 14:39:24 +0000 (14:39 +0000)
git-svn-id: file:///home/phd/archive/SVN/bookmarks_db/trunk@22 fdd5c36f-1aea-0310-aeeb-c58d7e2b6c23

sort_db.py

index 60e3d4179437ac47d0de23c81de13c65af1a3ea0..3e4399cd137d17ef795001d44aff75e2d3999d88 100755 (executable)
@@ -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)