diff --git a/Lib/python/pyrun.swg b/Lib/python/pyrun.swg index 034e2c8ef..d49b92fc6 100644 --- a/Lib/python/pyrun.swg +++ b/Lib/python/pyrun.swg @@ -1004,7 +1004,8 @@ SWIG_Python_ConvertPtrAndOwn(PyObject *obj, void **ptr, swig_type_info *ty, int *ptr = vptr; /* transfer the ownership to 'ptr' */ iobj->own = 0; - res = SWIG_AddNewMask(SWIG_AddCast(res)); + res = SWIG_AddCast(res); + res = SWIG_AddNewMask(res); } else { res = SWIG_AddCast(res); }