# HG changeset patch # User Dan Villiom Podlaski Christiansen # Date 1375457645 -7200 # Node ID aa043f64d8b73363f83891d7f99bbb734d33a598 # Parent 2316f2623dd4c4b458bd7f54c5771432b53eddaf tests: fix syntax incompatible with Python 2.4 diff --git a/tests/test_util.py b/tests/test_util.py --- 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