]> git.phdru.name Git - bookmarks_db.git/blobdiff - sort_db.py
Do not barf at int(None).
[bookmarks_db.git] / 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)