| 131 | } |
| 132 | |
| 133 | inline 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 | |
| 149 | VTK_ABI_NAMESPACE_BEGIN |
no outgoing calls
no test coverage detected