Sha256: de73087254ba6f32692af6e82f1b2c2b37b3c123ff1f72bc0e59b3e1bad3bf96

Contents?: true

Size: 574 Bytes

Versions: 7

Compression:

Stored size: 574 Bytes

Contents

#include "rp_error.h"

VALUE ePythonError;

void rp_pythonerror()
{
	PyObject *pType,*pValue,*pTraceback;
	PyObject *pTypeName;
	PyErr_Fetch(&pType,&pValue,&pTraceback);
	pTypeName=PyObject_GetAttrString(pType,"__name__");
	Py_XDECREF(pType);
	rb_raise(ePythonError,"%s:(%s)\n",STR2CSTR(ptor_obj(pTypeName)),STR2CSTR(rb_inspect(ptor_obj(pValue))));
	Py_XDECREF(pTraceback);
}

/*
Used to pass error information back into Ruby should an error occur in the embedded Python
interpreter.
*/
void Init_RubyPyError()
{
	ePythonError=rb_define_class("PythonError",rb_eException);
}

Version data entries

7 entries across 7 versions & 1 rubygems

Version Path
rubypython-0.2.8 ext/rubypython_bridge/rp_error.c
rubypython-0.2.7 ext/rubypython_bridge/rp_error.c
rubypython-0.2.4 ext/rubypython_bridge/rp_error.c
rubypython-0.2.5 ext/rubypython_bridge/rp_error.c
rubypython-0.2.3 ext/rubypython_bridge/rp_error.c
rubypython-0.2.2 ext/rubypython_bridge/rp_error.c
rubypython-0.2.6 ext/rubypython_bridge/rp_error.c