[FAQTS] Python Knowledge Base Update -- October 29th, 2000

Oleg Broytmann phd at phd.russ.ru
Mon Oct 30 04:15:34 EST 2000


Hi!

On 29 Oct 2000, Fiona Czuczman wrote:
> -------------------------------------------------------------
> I'm getting an error stating that "None" object has no attribute "groups" during setup of numpy, any ideas?
> http://www.faqts.com/knowledge-base/view.phtml/aid/6245
> -------------------------------------------------------------
> Michael Risser

   It seems you are trying to do the following - match or search for
regular expression:

match_object = re.search(pattern, string)
groups = match_object.groups()

   But your regexp didn't match anything in the string, so match_object
here is really None. Test it before doing anything with it:

match_object = re.search(pattern, string)
if match_object:
   groups = match_object.groups()
else:
   print "No match!"

Oleg.
---- 
     Oleg Broytmann            http://phd.pp.ru/            phd at phd.pp.ru
           Programmers don't die, they just GOSUB without RETURN.





More information about the Python-list mailing list