@@ -181,12 +181,12 @@ sequence_fast_get_item(PyObject *self, PyObject *args)
181181static PyObject *
182182object_setattr_null_exc (PyObject * self , PyObject * args )
183183{
184- PyObject * obj , * name ;
185- if (!PyArg_ParseTuple (args , "OO " , & obj , & name )) {
184+ PyObject * obj , * name , * exc ;
185+ if (!PyArg_ParseTuple (args , "OOO " , & obj , & name , & exc )) {
186186 return NULL ;
187187 }
188188
189- PyErr_SetString ( PyExc_ValueError , "error" );
189+ PyErr_SetObject (( PyObject * ) Py_TYPE ( exc ), exc );
190190 if (PyObject_SetAttr (obj , name , NULL ) < 0 ) {
191191 return NULL ;
192192 }
@@ -198,13 +198,13 @@ object_setattr_null_exc(PyObject *self, PyObject *args)
198198static PyObject *
199199object_setattrstring_null_exc (PyObject * self , PyObject * args )
200200{
201- PyObject * obj ;
201+ PyObject * obj , * exc ;
202202 const char * name ;
203- if (!PyArg_ParseTuple (args , "Os " , & obj , & name )) {
203+ if (!PyArg_ParseTuple (args , "OsO " , & obj , & name , & exc )) {
204204 return NULL ;
205205 }
206206
207- PyErr_SetString ( PyExc_ValueError , "error" );
207+ PyErr_SetObject (( PyObject * ) Py_TYPE ( exc ), exc );
208208 if (PyObject_SetAttrString (obj , name , NULL ) < 0 ) {
209209 return NULL ;
210210 }
0 commit comments