setup.py: keep Python 2.3 compatibility

Though we only support Python 2.4 or greater, we should keep setup.py
compatible with earlier versions on the syntactic level. Otherwise
people will simply get a SyntaxError when trying to install Mercurial
with an old version of Python. With this change, the setup.py file can
be imported with Python 2.3 and we then issue a friendly error message
when we detect that Python is too old.
This commit is contained in:
Martin Geisler 2009-12-23 19:11:37 +01:00
parent 2db60e73ce
commit 577446318e

View File

@ -145,8 +145,8 @@ if os.path.isdir('.hg'):
if version.endswith('+'):
version += time.strftime('%Y%m%d')
elif os.path.exists('.hg_archival.txt'):
kw = dict([t.strip() for t in l.split(':', 1)]
for l in open('.hg_archival.txt'))
kw = dict([[t.strip() for t in l.split(':', 1)]
for l in open('.hg_archival.txt')])
if 'tag' in kw:
version = kw['tag']
elif 'latesttag' in kw: