support to assign long to Quantity with Py2
This commit is contained in:
@@ -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<Base::QuantityPy*>(value);
|
||||
quant = *(pcObject->getQuantityPtr());
|
||||
|
||||
Reference in New Issue
Block a user