MCPcopy Create free account
hub / github.com/Kitware/VTK / vtkPrependPythonPath

Function vtkPrependPythonPath

Utilities/PythonInterpreter/vtkPythonInterpreter.cxx:133–146  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

131}
132
133inline void vtkPrependPythonPath(const char* pathtoadd)
134{
135 VTKPY_DEBUG_MESSAGE("adding module search path " << pathtoadd);
136 vtkPythonScopeGilEnsurer gilEnsurer;
137 PyObject* path = PySys_GetObject("path");
138 PyObject* newpath = PyUnicode_FromString(pathtoadd);
139
140 // avoid adding duplicate paths.
141 if (PySequence_Contains(path, newpath) == 0)
142 {
143 PyList_Insert(path, 0, newpath);
144 }
145 Py_DECREF(newpath);
146}
147}
148
149VTK_ABI_NAMESPACE_BEGIN

Callers 2

InitializeWithArgsMethod · 0.85
PrependPythonPathMethod · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected