Exemplo n.º 1
0
// Return module‘s __name__ value. If the module does not provide one, or if it is not a string,
// SystemError is raised and NULL is returned.
func (mod *Module) Name() (string, error) {
	ret := C.PyModule_GetName(mod.c())
	if ret == nil {
		return "", exception()
	}
	return C.GoString(ret), nil
}
Exemplo n.º 2
0
// char* PyModule_GetName(PyObject *module)
// Return module‘s __name__ value. If the module does not provide one, or if it is not a string, SystemError is raised and NULL is returned.
func PyModule_GetName(self *PyObject) string {
	c_name := C.PyModule_GetName(topy(self))
	// we do not own c_name...
	return C.GoString(c_name)
}