Strange problem ....

karthikbalaguru karthikbalaguru79 at gmail.com
Wed Jul 23 18:24:13 CEST 2008


On Jul 23, 1:31 pm, "Simon Brunning" <si... at brunningonline.net> wrote:
> 2008/7/23 karthikbalaguru <karthikbalagur... at gmail.com>:
>
> > I use Redhat 9.0, python-2.2.2-26, python-devel-2.2.2-26 and
> > db4-4.0.14-20.
>
> >  File "/usr/local/SDK/bin/../core/bin/processorlib.py", line 88
> >    yield ProcessorObjectInfo(child, self.pt)
> >                        ^
> > SyntaxError: invalid syntax
>
> > Is this error related with the version of python / python-devel that i
> > use .
> > Any ideas / tips ?
>
> Yup - generators (and hence the yield statement) were first introduced
> in Python 2.2, but in order to maintain backward compatibility, you'll
> need this line in any module using them:
>
> from __future__ import generators
>
> As of Python 2.3, this is no longer necessary, and I'd imagine that
> whatever you are running was targeted at a post 2.2 release.
>

Your answers helped me to solve the problem.

I found some while loop inside def children(def).

I initially tried by putting 'from __future__ import generators'
just before the
     def children(self):
present inside the class definition of 'DebugProcessorInfo'. But it
did not work.

Later i placed the 'from __future__ import generators' at the
beginning
of the python file and it worked sucessfully.

Thx for that info.
Karthik Balaguru




More information about the Python-list mailing list