From a3637a99967383effca24fb7c3d501e6d2dc3e41 Mon Sep 17 00:00:00 2001 From: Oleg Broytman Date: Fri, 24 Jul 2015 00:55:34 +0300 Subject: [PATCH] Fix a bug: id can be None --- reload_db.py | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/reload_db.py b/reload_db.py index 93eeac9..64e84f4 100755 --- a/reload_db.py +++ b/reload_db.py @@ -19,6 +19,7 @@ fs_encoding = xsetbg_conf.get("images", "fs_encoding") dump_file = open(sys.argv[1], 'rU') xsetbg_db = recreate_db() + def convert_str(s): if s == "None": return None @@ -50,7 +51,7 @@ for line in dump_file: query = txn.sqlrepr(Insert(xsetbg_db.sqlmeta.table, values=values)) txn.query(query) else: - assert row.id == id + assert id is None or row.id == id assert row.last_shown == timestamp txn.commit() -- 2.39.5