MCPcopy Create free account
hub / github.com/goplus/py / AddToPath

Function AddToPath

python.go:39–57  ·  view source on GitHub ↗
(dir string)

Source from the content-addressed store, hash-verified

37}
38
39func AddToPath(dir string) {
40 p := C.CString("path")
41 defer C.free(unsafe.Pointer(p))
42
43 sys_path := C.PySys_GetObject(p)
44 if sys_path == nil {
45 return
46 }
47
48 s := C.CString(dir)
49 defer C.free(unsafe.Pointer(s))
50
51 pDir := C.PyString_FromString(s)
52 if pDir == nil {
53 return
54 }
55
56 C.PyList_Append(sys_path, pDir)
57}
58
59func Main(args []string) int {
60 argv := make([]*C.char, len(args))

Callers

nothing calls this directly

Calls

no outgoing calls

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…