From 0e8974a370f0428d3ea2044f4e9c50365d0b23c5 Mon Sep 17 00:00:00 2001 From: Yorik van Havre Date: Tue, 9 Feb 2016 16:01:10 -0200 Subject: [PATCH] Made PropertyFloatList accept ints too - fixes #2444 --- src/App/PropertyStandard.cpp | 13 ++++++++++--- 1 file changed, 10 insertions(+), 3 deletions(-) diff --git a/src/App/PropertyStandard.cpp b/src/App/PropertyStandard.cpp index 983e19263..a177806b8 100644 --- a/src/App/PropertyStandard.cpp +++ b/src/App/PropertyStandard.cpp @@ -1142,13 +1142,20 @@ void PropertyFloatList::setPyObject(PyObject *value) for (Py_ssize_t i=0; i= 3 + } else if (PyLong_Check(item)) { + values[i] = static_cast(PyLong_AsLong(item)); +#else + } else if (PyInt_Check(item)) { + values[i] = static_cast(PyInt_AsLong(item)); +#endif + } else { std::string error = std::string("type in list must be float, not "); error += item->ob_type->tp_name; throw Base::TypeError(error); } - - values[i] = PyFloat_AsDouble(item); } setValues(values);