PyAPI: add optional imports to expression eval API

Avoids having to use `__import__` to access modules.
This commit is contained in:
2018-09-03 12:38:19 +10:00
parent 4bb8dba340
commit 7ff1750218
7 changed files with 62 additions and 30 deletions

View File

@@ -204,7 +204,7 @@ static PyObject *bpyunits_to_value(PyObject *UNUSED(self), PyObject *args, PyObj
bUnit_ReplaceString(str, (int)str_len, uref, scale, usys, ucat);
if (!PyC_RunString_AsNumber(str, "<bpy_units_api>", &result)) {
if (!PyC_RunString_AsNumber(NULL, str, "<bpy_units_api>", &result)) {
if (PyErr_Occurred()) {
PyErr_Print();
PyErr_Clear();