PyInt_FromLong gives segfault on small numbers (<257)

Marcos Prieto markken at
Thu Aug 5 14:04:36 CEST 2010


I'm trying to call python (python 2.6) functions from C++ using MS VC+
+ 6.0 and any calls to PyInt_FromLong with numbers below 257 give me
exceptions, no problems with bigger numbers

PyObject *pValue;

pValue = PyInt_FromLong(1L); (or pValue = PyInt_FromLong(1);

Any ideas of what can I be doing wrong?



More information about the Python-list mailing list