X-Git-Url: https://git.phdru.name/?a=blobdiff_plain;f=sort_db.py;fp=sort_db.py;h=3e4399cd137d17ef795001d44aff75e2d3999d88;hb=43c6fe1b6c14b7494e1c73ef57b61ae8c11f956a;hp=60e3d4179437ac47d0de23c81de13c65af1a3ea0;hpb=364bdf891fa30093391583c449ebc7cbab4ec2a5;p=bookmarks_db.git 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)