diff --git a/Lib/python/pystdcommon.swg b/Lib/python/pystdcommon.swg index ac3b7b5e9..12c370e59 100644 --- a/Lib/python/pystdcommon.swg +++ b/Lib/python/pystdcommon.swg @@ -133,8 +133,8 @@ namespace swig { struct traits_as { static Type as(PyObject *obj, bool throw_error) { Type *v = 0; - int res = (obj ? traits_asptr::asptr(obj, &v) : 0) && v; - if (res) { + int res = (obj ? traits_asptr::asptr(obj, &v) : 0); + if (res && v) { if (res == SWIG_NEWOBJ) { Type r(*v); delete v;