changeset 110:b9fdae6a536a

make python 2.4 compatible :(
author Jeff Hammel <jhammel@mozilla.com>
date Thu, 10 May 2012 15:23:11 -0700
parents 09642528be02
children 16e3b23c80a6
files configuration/configuration.py
diffstat 1 files changed, 7 insertions(+), 4 deletions(-) [+]
line wrap: on
line diff
--- a/configuration/configuration.py	Thu May 03 16:00:18 2012 -0700
+++ b/configuration/configuration.py	Thu May 10 15:23:11 2012 -0700
@@ -65,12 +65,15 @@
         else:
             f = filename
             newfile = False
+        exception = None
         try:
             self._write(f, config)
-        finally:
-            # XXX try: finally: works in python >= 2.5
-            if newfile:
-                f.close()
+        except Exception, exception:
+            pass
+        if newfile:
+            f.close()
+        if exception:
+            raise exception
     def _write(self, fp, config):
         raise NotImplementedError("Abstract base class")