Fixed wrong value returned by ParameterPy::GetUnsigned

This commit is contained in:
Yorik van Havre 2016-01-30 17:24:28 -02:00
parent 15a4976c97
commit 2cb06c6f65

View File

@ -276,8 +276,8 @@ Py::Object ParameterGrpPy::getUnsigned(const Py::Tuple& args)
if (!PyArg_ParseTuple(args.ptr(), "s|I", &pstr,&UInt))
throw Py::Exception();
#if PY_MAJOR_VERSION < 3
int cropped = _cParamGrp->GetUnsigned(pstr,UInt) & INT_MAX;
return Py::Int(cropped);
PyObject* val = Py_BuildValue("I",_cParamGrp->GetUnsigned(pstr,UInt));
return Py::Int(val);
#else
return Py::Long(_cParamGrp->GetUnsigned(pstr,UInt));
#endif