diff tests/test_util.py @ 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 6945d3359456
children 70090e2ee262
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