diff --git a/src/gen/db/write.py b/src/gen/db/write.py index 6b367cb57..13f8655fb 100644 --- a/src/gen/db/write.py +++ b/src/gen/db/write.py @@ -1008,7 +1008,8 @@ class DbBsddb(DbBsddbRead, DbWriteBase, UpdateCallback): Bail out if the incompatible version is discovered: * close cleanly to not damage data/env """ - self.metadata.close() + if hasattr(self, 'metadata') and self.metadata: + self.metadata.close() self.env.close() self.metadata = None self.env = None