I m learning python c api functions and keen to learn python 3.1 stable version. Found a same kind of issue recently and tried
PyModule_AddIntConstant(PyObject *module, const char *name, long value) Runtime error occurred for this function call.
Is there something wrong with the function in python 3.1?