Base: Quantity: return std::string

This commit is contained in:
Ladislav Michl
2024-07-13 13:07:27 +02:00
committed by Yorik van Havre
parent 9f7218ac75
commit 0b3adee2ab
58 changed files with 573 additions and 592 deletions

View File

@@ -84,10 +84,10 @@ int UnitPy::PyInit(PyObject* args, PyObject* /*kwd*/)
// get string
char* string {};
if (PyArg_ParseTuple(args, "et", "utf-8", &string)) {
QString qstr = QString::fromUtf8(string);
std::string str(string);
PyMem_Free(string);
try {
*self = Quantity::parse(qstr).getUnit();
*self = Quantity::parse(str).getUnit();
return 0;
}
catch (const Base::ParserError& e) {