From: Oleg Broytman Date: Thu, 23 Jul 2015 21:55:34 +0000 (+0300) Subject: Fix a bug: id can be None X-Git-Tag: v5.0.0~10 X-Git-Url: https://git.phdru.name/?a=commitdiff_plain;h=a3637a99967383effca24fb7c3d501e6d2dc3e41;p=xsetbg.git Fix a bug: id can be None --- 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()