enforce cast of object to string */
| 390 | |
| 391 | /* enforce cast of object to string */ |
| 392 | static char * |
| 393 | object_to_string(PyObject *obj) |
| 394 | { |
| 395 | if (obj) |
| 396 | { |
| 397 | PyObject *so = PyObject_Str(obj); |
| 398 | |
| 399 | if (so != NULL) |
| 400 | { |
| 401 | char *str; |
| 402 | |
| 403 | str = pstrdup(PyString_AsString(so)); |
| 404 | Py_DECREF(so); |
| 405 | |
| 406 | return str; |
| 407 | } |
| 408 | } |
| 409 | |
| 410 | return NULL; |
| 411 | } |
| 412 | |
| 413 | static PyObject * |
| 414 | PLy_output(volatile int level, PyObject *self, PyObject *args, PyObject *kw) |