Commit 0b1270e0 authored by Utkarsh Ayachit's avatar Utkarsh Ayachit

init sys.argv in embedded Python environment.

parent 4a20a3df
...@@ -217,6 +217,10 @@ bool vtkPythonInterpreter::Initialize(int initsigs /*=0*/) ...@@ -217,6 +217,10 @@ bool vtkPythonInterpreter::Initialize(int initsigs /*=0*/)
Py_InitializeEx(initsigs); Py_InitializeEx(initsigs);
// setup default argv. Without this, code snippets that check `sys.argv` may
// fail when run in embedded VTK Python environment.
PySys_SetArgvEx(0, nullptr, 0);
#ifdef SIGINT #ifdef SIGINT
// Put default SIGINT handler back after Py_Initialize/Py_InitializeEx. // Put default SIGINT handler back after Py_Initialize/Py_InitializeEx.
signal(SIGINT, SIG_DFL); signal(SIGINT, SIG_DFL);
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment