[svn.haxx.se] · SVN Dev · SVN Users · SVN Org · TSVN Dev · TSVN Users · Subclipse Dev · Subclipse Users · this month's index

Re: [PATCH] Enable running autogen.sh with Python <2.1

From: David James <james82_at_gmail.com>
Date: 2005-10-15 07:50:19 CEST

On 10/15/05, Kobayashi Noritada <nori1@dolphin.c.u-tokyo.ac.jp> wrote:
> Hi,
>
> In my environment with Python 2.1, autogen.sh fails in the trunk and
> in the 1.3.x branch due to the scope issue of a variable in
> build/generator/gen_make.py.
> This patch enable running autogen.sh with Python <2.1 as well as >2.2.
>
> May I commit it?
Looks great! Your code not only fixes the Python 2.1 problem but it
also easier to read. +1. Please also nominate your fix for the 1.3.x
branch.

I have only a minor suggestion. Can you use "append(" instead of
"append ("? (We try to avoid spaces before parentheses in Python
code).

> (or require building from autogen.sh with Python >2.2?)
This might be a good idea. Does adding "from __future__ import
nested_scopes" also resolve the problem with Python 2.1?

> [[[
> Enable running autogen.sh with Python <2.1, in which the scope of variables
> within lambda is restricted.
>
> * build/generator/gen_make.py (Generator.write):
> Make use of the 'for' loop instead of map and lambda so as to resolve the
> scope issue with Python <2.1.
> ]]]
>
>
> Index: build/generator/gen_make.py
> ===================================================================
> --- build/generator/gen_make.py (revision 16723)
> +++ build/generator/gen_make.py (working copy)
> @@ -154,7 +154,9 @@
> python_script = "$(abs_srcdir)/build/generator/swig/external_runtime.py"
> build_runtime = '$(PYTHON) %s ' % python_script + \
> '$(abs_srcdir)/build.conf "$(SWIG)"'
> - runtimes = map(lambda lang: runtime_pattern % lang, self.swig_lang)
> + runtimes = []
> + for lang in self.swig_lang:
> + runtimes.append (runtime_pattern % lang)
> self.ofile.write(
> '%s:\n' % " ".join(runtimes) +
> '\t%s\n' % build_runtime +
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: dev-unsubscribe@subversion.tigris.org
> For additional commands, e-mail: dev-help@subversion.tigris.org
>
>

--
David James -- http://www.cs.toronto.edu/~james
Received on Sat Oct 15 07:51:14 2005

This is an archived mail posted to the Subversion Dev mailing list.