From ef8a92578b79d624eaa60a1417201cffb0b898b7 Mon Sep 17 00:00:00 2001 From: William S Fulton Date: Sat, 29 Dec 2018 12:09:04 +0000 Subject: [PATCH] Correct Python implicitconv code Py_None is only possible with implicitconv so move this block of code into the implicitconv if block. --- Lib/python/pyrun.swg | 14 +++++++------- 1 file changed, 7 insertions(+), 7 deletions(-) diff --git a/Lib/python/pyrun.swg b/Lib/python/pyrun.swg index 0759b8f27..ad1b81963 100644 --- a/Lib/python/pyrun.swg +++ b/Lib/python/pyrun.swg @@ -1098,13 +1098,13 @@ SWIG_Python_ConvertPtrAndOwn(PyObject *obj, void **ptr, swig_type_info *ty, int } } } - } - if (!SWIG_IsOK(res) && obj == Py_None) { - if (ptr) - *ptr = 0; - if (PyErr_Occurred()) - PyErr_Clear(); - res = SWIG_OK; + if (!SWIG_IsOK(res) && obj == Py_None) { + if (ptr) + *ptr = 0; + if (PyErr_Occurred()) + PyErr_Clear(); + res = SWIG_OK; + } } } return res;