PyNumber_Int screwing Object.

  • Thread starter =?iso-8859-1?Q?Jos=E9_Rui_Faustino_de_Sousa?=
  • Start date
?

=?iso-8859-1?Q?Jos=E9_Rui_Faustino_de_Sousa?=

Hi!

This code snippet is broken in the case that the argument passed is a
complex number

PyObject* tmp = Py_None;

tmp=PyNumber_Int(object);
tmp=PyObject_GetAttrString(object,"real");

it wreaks havoc on Python making it fail in weird ways.

If I insert the line between the other two

if(!tmp) PyErr_Clear();

things seem to work.

I have googled around and it does not seem to be a common practice...

Anyone can lend an hand?

Thank you very much.

Best regards
José Rui

P.S.- I include a more complete example.

--
========================================================================
"Every sentence I utter must be understood not as an affirmation, but as
a question." Niels Bohr
========================================================================
mailto://[email protected]/ Crawler baith. UnCaps me to reply.
Contact information: http://homepage.esoterica.pt/~jrfsousa/contact.html
========================================================================
 

Members online

Forum statistics

Threads
473,769
Messages
2,569,580
Members
45,054
Latest member
TrimKetoBoost

Latest Threads

Top