handle NULL arguments to iocsh calls
This commit is contained in:
@ -66,6 +66,9 @@ void py(const char* code)
|
|||||||
{
|
{
|
||||||
PyGILState_STATE state;
|
PyGILState_STATE state;
|
||||||
|
|
||||||
|
if(!code)
|
||||||
|
return;
|
||||||
|
|
||||||
state = PyGILState_Ensure();
|
state = PyGILState_Ensure();
|
||||||
|
|
||||||
if(PyRun_SimpleStringFlags(code, NULL)!=0)
|
if(PyRun_SimpleStringFlags(code, NULL)!=0)
|
||||||
@ -79,6 +82,9 @@ void pyfile(const char* file)
|
|||||||
FILE *fp;
|
FILE *fp;
|
||||||
PyGILState_STATE state;
|
PyGILState_STATE state;
|
||||||
|
|
||||||
|
if(!file)
|
||||||
|
return;
|
||||||
|
|
||||||
state = PyGILState_Ensure();
|
state = PyGILState_Ensure();
|
||||||
|
|
||||||
fp = fopen(file, "r");
|
fp = fopen(file, "r");
|
||||||
|
Reference in New Issue
Block a user