summaryrefslogtreecommitdiffstats
path: root/Doc/c-api/arg.rst
diff options
context:
space:
mode:
authorMartin v. Löwis <martin@v.loewis.de>2009-05-29 14:47:46 (GMT)
committerMartin v. Löwis <martin@v.loewis.de>2009-05-29 14:47:46 (GMT)
commitc15bdef8190241357970c9d65783c929860b933a (patch)
tree41a040a97ca95f748b6b4bc0ed4f2b39e5f729b1 /Doc/c-api/arg.rst
parent2703fd9134e46146df51b1af383632d5769faebd (diff)
downloadcpython-c15bdef8190241357970c9d65783c929860b933a.zip
cpython-c15bdef8190241357970c9d65783c929860b933a.tar.gz
cpython-c15bdef8190241357970c9d65783c929860b933a.tar.bz2
Issue #6012: Add cleanup support to O& argument parsing.
Diffstat (limited to 'Doc/c-api/arg.rst')
-rw-r--r--Doc/c-api/arg.rst8
1 files changed, 8 insertions, 0 deletions
diff --git a/Doc/c-api/arg.rst b/Doc/c-api/arg.rst
index dcf7547..e968c8f 100644
--- a/Doc/c-api/arg.rst
+++ b/Doc/c-api/arg.rst
@@ -250,6 +250,14 @@ variable(s) whose address should be passed.
the conversion has failed. When the conversion fails, the *converter* function
should raise an exception and leave the content of *address* unmodified.
+ If the *converter* returns Py_CLEANUP_SUPPORTED, it may get called a second time
+ if the argument parsing eventually fails, giving the converter a chance to release
+ any memory that it had already allocated. In this second call, the *object* parameter
+ will be NULL; *address* will have the same value as in the original call.
+
+ .. versionchanged:: 3.1
+ Py_CLEANUP_SUPPORTED was added.
+
``S`` (string) [PyStringObject \*]
Like ``O`` but requires that the Python object is a string object. Raises
:exc:`TypeError` if the object is not a string object. The C variable may also