improve error messages for variables and python commands

This commit is contained in:
Axel Kohlmeyer
2020-09-23 19:02:55 -04:00
parent 2f8a5ddd1f
commit b350dce573
2 changed files with 16 additions and 13 deletions

View File

@ -235,12 +235,14 @@ void PythonImpl::command(int narg, char **arg)
if (!pFunc) {
PyGILState_Release(gstate);
error->all(FLERR,"Could not find Python function");
error->all(FLERR,fmt::format("Could not find Python function {}",
pfuncs[ifunc].name));
}
if (!PyCallable_Check(pFunc)) {
PyGILState_Release(gstate);
error->all(FLERR,"Python function is not callable");
error->all(FLERR,fmt::format("Python function {} is not callable",
pfuncs[ifunc].name));
}
pfuncs[ifunc].pFunc = (void *) pFunc;