Strange problem ....

Simon Brunning simon at brunningonline.net
Wed Jul 23 04:31:49 EDT 2008


2008/7/23 karthikbalaguru <karthikbalaguru79 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.

-- 
Cheers,
Simon B.
simon at brunningonline.net
http://www.brunningonline.net/simon/blog/
GTalk: simon.brunning | MSN: small_values | Yahoo: smallvalues | Twitter: brunns



More information about the Python-list mailing list