]> git.ipfire.org Git - thirdparty/Python/cpython.git/commitdiff
Add Py_RETURN_NOTIMPLEMENTED macro. Fixes #12724.
authorBrian Curtin <brian@python.org>
Thu, 11 Aug 2011 01:05:21 +0000 (20:05 -0500)
committerBrian Curtin <brian@python.org>
Thu, 11 Aug 2011 01:05:21 +0000 (20:05 -0500)
Include/object.h

index 37537859668d6c67c04187667aeba556000c99d8..e0c68c133d6e33bafd98fd72c21f6e9175519e1d 100644 (file)
@@ -792,6 +792,10 @@ not implemented for a given type combination.
 PyAPI_DATA(PyObject) _Py_NotImplementedStruct; /* Don't use this directly */
 #define Py_NotImplemented (&_Py_NotImplementedStruct)
 
+/* Macro for returning Py_NotImplemented from a function */
+#define Py_RETURN_NOTIMPLEMENTED \
+    return Py_INCREF(Py_NotImplemented), Py_NotImplemented
+
 /* Rich comparison opcodes */
 #define Py_LT 0
 #define Py_LE 1