From e9975ee81493469038f3eeedba40df43293ef273 Mon Sep 17 00:00:00 2001 From: wmayer Date: Wed, 28 Jun 2017 23:12:00 +0200 Subject: [PATCH] support to assign long to Quantity with Py2 --- src/App/PropertyUnits.cpp | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/src/App/PropertyUnits.cpp b/src/App/PropertyUnits.cpp index f757349d9d..db796da966 100644 --- a/src/App/PropertyUnits.cpp +++ b/src/App/PropertyUnits.cpp @@ -94,10 +94,9 @@ Base::Quantity PropertyQuantity::createQuantityFromPy(PyObject *value) #if PY_MAJOR_VERSION < 3 else if (PyInt_Check(value)) quant = Quantity((double)PyInt_AsLong(value),_Unit); -#else +#endif else if (PyLong_Check(value)) quant = Quantity((double)PyLong_AsLong(value),_Unit); -#endif else if (PyObject_TypeCheck(value, &(QuantityPy::Type))) { Base::QuantityPy *pcObject = static_cast(value); quant = *(pcObject->getQuantityPtr());