# HG changeset patch # User Jeff Hammel # Date 1336688591 25200 # Node ID b9fdae6a536a06653807683d458805f6fb3ccb9a # Parent 09642528be02679175826756f9ed194911f1b46b make python 2.4 compatible :( diff -r 09642528be02 -r b9fdae6a536a configuration/configuration.py --- 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")