From 4f75726251a7e2d8e898794e9868bdec75c235d3 Mon Sep 17 00:00:00 2001 From: gschnabel <40870991+gschnabel@users.noreply.github.com> Date: Mon, 21 Oct 2024 14:20:25 +0200 Subject: [PATCH] docs: fix error condition in custom type caster example --- docs/advanced/cast/custom.rst | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/docs/advanced/cast/custom.rst b/docs/advanced/cast/custom.rst index 8138cac61..b9fd41805 100644 --- a/docs/advanced/cast/custom.rst +++ b/docs/advanced/cast/custom.rst @@ -64,7 +64,7 @@ type is explicitly allowed. value.long_value = PyLong_AsLong(tmp); Py_DECREF(tmp); /* Ensure return code was OK (to avoid out-of-range errors etc) */ - return !(value.long_value == -1 && !PyErr_Occurred()); + return !(value.long_value == -1 && PyErr_Occurred()); } /**