En Tue, 10 Mar 2009 12:32:00 -0200, <googler.1.webmas...@spamgourmet.com> escribió:

Hi!

I have a problem with PyEval_EvalCode(...)
I compile the following code and execute them with PyEval_EvalCode
(...)


class MyClass(mod.Upper):
    pass

register(MyClass) #just the type, not the instance


Thats all. So register(...) is a Python C API method so i take the
type and store
it in a global variable.

...and increment its reference count, of course, because you store a new reference, ok?

PyEval_EvalCode(...) returns not NULL and I
do not decref
the dictionary, just the returnvalue.

Which dictionary? The return value should be None, I presume.
You should post the code. By far, the most frequent error using the Python API is getting reference counts wrong.

--
Gabriel Genellina

--
http://mail.python.org/mailman/listinfo/python-list

Reply via email to