Issue #6012: Add cleanup support to O& argument parsing.

This commit is contained in:
Martin v. Löwis 2009-05-29 14:47:46 +00:00
parent 2703fd9134
commit c15bdef819
9 changed files with 120 additions and 11 deletions

View file

@ -1539,6 +1539,10 @@ PyUnicode_FSConverter(PyObject* arg, void* addr)
PyObject *output = NULL;
Py_ssize_t size;
void *data;
if (arg == NULL) {
Py_DECREF(*(PyObject**)addr);
return 1;
}
if (PyBytes_Check(arg) || PyByteArray_Check(arg)) {
output = arg;
Py_INCREF(output);
@ -1573,7 +1577,7 @@ PyUnicode_FSConverter(PyObject* arg, void* addr)
return 0;
}
*(PyObject**)addr = output;
return 1;
return Py_CLEANUP_SUPPORTED;
}