[Python-checkins] CVS: python/dist/src/Lib/distutils/command
build_scripts.py,1.13,1.14
M.-A. Lemburg
mal@lemburg.com
Tue, 11 Dec 2001 22:16:23 +0100
Andrew Kuchling wrote:
>
> On Tue, Dec 11, 2001 at 12:44:44PM -0800, M.-A. Lemburg wrote:
> >*** build_scripts.py 2001/12/10 16:15:44 1.13
> >--- build_scripts.py 2001/12/11 20:44:42 1.14
> >***************
> >*** 81,85 ****
> > if match:
> > adjust = 1
> >! post_interp = match.group(1)
> >
> > if adjust:
> >--- 81,85 ----
> > if match:
> > adjust = 1
> >! post_interp = match.group(1) or ''
>
> Careful; a similar fix was suggested for bug #475009, but the correct
> fix was to tighten up the regex pattern for the first line.
I did see the '$' but still think that the code is wrong:
>>> first_line_re.match('#!/usr/bin/python').groups()
(None,)
That is: the first line can match, but not include any extra
flags such as ' -O' or ' -uO', so 'None' is still a possible
outcome (due to the '?' behind the group).
--
Marc-Andre Lemburg
CEO eGenix.com Software GmbH
______________________________________________________________________
Consulting & Company: http://www.egenix.com/
Python Software: http://www.lemburg.com/python/