[Python-Dev] Problem in SRE ?

M.-A. Lemburg mal@lemburg.com
Wed, 07 Nov 2001 19:08:41 +0100


Solved...

"M.-A. Lemburg" wrote:
> 
> Michael Hudson wrote:
> >
> > "M.-A. Lemburg" <mal@lemburg.com> writes:
> >
> > > I've just run across a strange problem with SRE. The following
> > > code does not run with the current CVS version -- the program
> > > simply exists without notice even though there doesn't seem
> > > to be an exit() or abort() call in SRE.
> >
> > Well, your regexp doesn't work for the given version:
> >
> > > Note that sys.version is
> > > '2.2b1+ (#59, Nov  7 2001, 12:57:29) \n[GCC pgcc-2.95.2 19991024
> > > (release)]'
> > >
> > > Any ideas ?
> > >
> > > --
> > > import sys, re, string
> > > _sys_version_parser = re.compile('([\w.]+)\s*'
> >
> > You need a \+? in here somewhere!  Or a + inside the [].
> 
> True and thanks for the hint, but still: why does Python exit ?
> 
> I'd expect a None return, or rather an attribute error since
> I'm asking for the .groups() method of None.
> 
> Something is either wrong with my compiler or some attribute lookup
> code (or both).

Sorry about the mixup: the application which was using the code 
was masking the AttributeError and did the sys.exit().
 
-- 
Marc-Andre Lemburg
CEO eGenix.com Software GmbH
______________________________________________________________________
Consulting & Company:                           http://www.egenix.com/
Python Software:                        http://www.lemburg.com/python/