Making a C extension compatible with 2.2

Martin v. Löwis loewis at informatik.hu-berlin.de
Wed Apr 17 13:27:15 EDT 2002


hamish_lawson at yahoo.co.uk (Hamish Lawson) writes:

> Must anything be done to make a C extension compatible with Python
> 2.2? 

Not that I know of. About the only thing is that the GC API has
changed; if you use the old GC API, it will still work fine, except
that your types don't participate in GC anymore.

> I have an extension (not my own) that ran fine under Python 2.1
> on Solaris 2.6. I have since recompiled it for Python 2.2, but
> sometimes I now get tuple indexing errors - and not necessarily at a
> point in my Python code where the loaded extension is actually being
> called upon. Running the same code under Python 2.1 is OK. Would I be
> right in thinking it may be related to the changes in Python 2.2 for
> the new iterator protocol?

It might be that Python 2.2 exposes a bug in the module that was
hidden so far. But I would expect that the bug was always present, and
is just now exposed.

Unfortunately, the only way to find out will be to analyse this in
detail. Using a Python debug build might help, though.

Regards,
Martin




More information about the Python-list mailing list