Skip to content

Commit

Permalink
support to assign long to Quantity with Py2
Browse files Browse the repository at this point in the history
  • Loading branch information
wwmayer committed Jun 28, 2017
1 parent a32972e commit 51c6ca0
Showing 1 changed file with 1 addition and 2 deletions.
3 changes: 1 addition & 2 deletions src/App/PropertyUnits.cpp
Expand Up @@ -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());
Expand Down

0 comments on commit 51c6ca0

Please sign in to comment.