changeset 1038:aa043f64d8b7

tests: fix syntax incompatible with Python 2.4
author Dan Villiom Podlaski Christiansen <dan@cabo.dk>
date Fri, 02 Aug 2013 17:34:05 +0200
parents 2316f2623dd4
children 3df6ed4e7561
files tests/test_util.py
diffstat 1 files changed, 4 insertions(+), 1 deletions(-) [+]
line wrap: on
line diff
--- a/tests/test_util.py
+++ b/tests/test_util.py
@@ -282,8 +282,11 @@ class TestBase(unittest.TestCase):
         setattr(ui.ui, self.patch[0].func_name, self.patch[1])
 
     def setup_svn_config(self, config):
-        with open(self.config_dir + '/config', 'w') as c:
+        c = open(self.config_dir + '/config', 'w')
+        try:
             c.write(config)
+        finally:
+            c.close()
 
     def _makerepopath(self):
         self.repocount += 1