Skip to content

Commit

Permalink
pyldb: Don't use the internal macro PyObject_REPR
Browse files Browse the repository at this point in the history
Signed-off-by: Petr Viktorin <[email protected]>
Reviewed-by: Andrew Bartlett <[email protected]>
Reviewed-by: Stefan Metzmacher <[email protected]>
  • Loading branch information
encukou authored and metze-samba committed Nov 5, 2015
1 parent 7935796 commit 2e298c1
Showing 1 changed file with 8 additions and 2 deletions.
10 changes: 8 additions & 2 deletions lib/ldb/pyldb.c
Original file line number Diff line number Diff line change
Expand Up @@ -3002,10 +3002,16 @@ static PyGetSetDef py_ldb_msg_getset[] = {

static PyObject *py_ldb_msg_repr(PyLdbMessageObject *self)
{
PyObject *dict = PyDict_New(), *ret;
PyObject *dict = PyDict_New(), *ret, *repr;
if (PyDict_Update(dict, (PyObject *)self) != 0)
return NULL;
ret = PyString_FromFormat("Message(%s)", PyObject_REPR(dict));
repr = PyObject_Repr(dict);
if (repr == NULL) {
Py_DECREF(dict);
return NULL;
}
ret = PyString_FromFormat("Message(%s)", PyString_AsString(repr));
Py_DECREF(repr);
Py_DECREF(dict);
return ret;
}
Expand Down

0 comments on commit 2e298c1

Please sign in to comment.