MCPcopy Create free account
hub / github.com/rabbitstack/fibratus / AddPythonPath

Function AddPythonPath

pkg/filament/cpython/interpreter.go:77–83  ·  view source on GitHub ↗

AddPythonPath adds a new path to the PYTHONPATH environment variable.

(path string)

Source from the content-addressed store, hash-verified

75
76// AddPythonPath adds a new path to the PYTHONPATH environment variable.
77func AddPythonPath(path string) {
78 syspath := C.CString("path")
79 defer C.free(unsafe.Pointer(syspath))
80 newPath := PyUnicodeFromString(path)
81 defer newPath.DecRef()
82 C.PyList_Append(C.PySys_GetObject(syspath), newPath.rawptr)
83}
84
85// SetPath sets the default module search path. If this function is called before Py_Initialize(), then Py_GetPath()
86// won’t attempt to compute a default search path but uses the one provided instead. This is useful if Python is

Callers 3

NewFunction · 0.92
TestNewModuleFunction · 0.85
TestModuleRegisterFnFunction · 0.85

Calls 2

PyUnicodeFromStringFunction · 0.85
DecRefMethod · 0.80

Tested by 2

TestNewModuleFunction · 0.68
TestModuleRegisterFnFunction · 0.68