Some fixes in unit system

This commit is contained in:
jriegel
2013-12-08 19:48:02 +01:00
parent b6025019df
commit cfa7045408
10 changed files with 275 additions and 203 deletions

View File

@@ -64,8 +64,13 @@ int QuantityPy::PyInit(PyObject* args, PyObject* kwd)
PyErr_Clear(); // set by PyArg_ParseTuple()
const char* string;
if (PyArg_ParseTuple(args,"s", &string)) {
*self = Quantity::parse(string);
try {
*self = Quantity::parse(string);
}catch(const Base::Exception& e) {
PyErr_SetString(PyExc_ImportError, e.what());
return-1;
}
return 0;
}