fix Py3 issue

This commit is contained in:
wmayer
2017-07-25 01:07:09 +02:00
parent e32c37598b
commit 07261b161d

View File

@@ -624,7 +624,11 @@ void QuantityPy::setFormat(Py::Tuple arg)
Py::Char form(arg.getItem(1));
fmt.precision = static_cast<int>(prec);
#if PY_MAJOR_VERSION >= 3
std::string fmtstr = static_cast<std::string>(Py::String(form));
#else
std::string fmtstr = static_cast<std::string>(form);
#endif
if (fmtstr.size() != 1)
throw Py::ValueError("Invalid format character");
switch (fmtstr.front()) {