From 1bb1c1aba3d0729acd8a1bfaf01f5460c520c40a Mon Sep 17 00:00:00 2001 From: Thomas Perl Date: Sat, 12 Jun 2010 15:07:05 +0200 Subject: [PATCH] Ignore rows with invalid values in minidb --- src/gpodder/minidb.py | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/src/gpodder/minidb.py b/src/gpodder/minidb.py index 715bb9c8..898b55cd 100644 --- a/src/gpodder/minidb.py +++ b/src/gpodder/minidb.py @@ -154,9 +154,12 @@ class Store(object): def apply(row): o = class_.__new__(class_) for attr, value in zip(slots, row): - self._set(o, attr, value) + try: + self._set(o, attr, value) + except ValueError, ve: + return None return o - return [apply(row) for row in cur] + return filter(lambda x: x is not None, [apply(row) for row in cur]) def get(self, class_, **kwargs): result = self.load(class_, **kwargs) -- 2.11.4.GIT