From b44a08d2bd7c4295d32dfe625e744b785a660810 Mon Sep 17 00:00:00 2001 From: Valentin Lorentz Date: Fri, 3 Jan 2014 17:48:30 +0000 Subject: [PATCH] Fix previous merge (again). --- src/dbi.py | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/src/dbi.py b/src/dbi.py index b353d7ecc..fbeeeea30 100644 --- a/src/dbi.py +++ b/src/dbi.py @@ -161,7 +161,8 @@ class FlatfileMapping(MappingInterface): self.currentId = 0 self._incrementCurrentId() finally: - fd.close() + if 'fd' in locals(): + fd.close() def _canonicalId(self, id): if id is not None: