From 2c3f9fe24aa1ce42f4fc404899a4bd3acecbe91a Mon Sep 17 00:00:00 2001 From: Fabio Erculiani Date: Sat, 2 May 2009 18:12:14 +0200 Subject: [PATCH] entropy.db: skip tables that cannot be dropped on initializeDatabase --- libraries/entropy/db.py | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/libraries/entropy/db.py b/libraries/entropy/db.py index cddfb4f42..5121f3b80 100644 --- a/libraries/entropy/db.py +++ b/libraries/entropy/db.py @@ -570,7 +570,11 @@ class LocalRepository: self.checkReadOnly() my = Schema() for table in self.listAllTables(): - self.cursor.execute("DROP TABLE %s" % (table,)) + try: + self.cursor.execute("DROP TABLE %s" % (table,)) + except self.dbapi2.OperationalError: + # skip tables that can't be dropped + continue self.cursor.executescript(my.get_init()) self.databaseStructureUpdates() # set cache size