scons: Fix Python 2.6 compatibility

Don't use Python 2.7-style with statements in the SConstruct file.
This commit is contained in:
Andreas Sandberg 2016-04-18 10:40:50 +01:00
parent f819518158
commit 68a7752d73

View file

@ -332,9 +332,7 @@ if not ignore_style and hgdir.exists():
shutil.copyfile(hgrc.abspath, hgrc_old.abspath)
re_style_hook = re.compile(r"^([^=#]+)\.style\s*=\s*([^#\s]+).*")
re_style_extension = re.compile("style\s*=\s*([^#\s]+).*")
with open(hgrc_old.abspath, 'r') as old, \
open(hgrc.abspath, 'w') as new:
old, new = open(hgrc_old.abspath, 'r'), open(hgrc.abspath, 'w')
for l in old:
m_hook = re_style_hook.match(l)
m_ext = re_style_extension.match(l)