Skip to content
This repository was archived by the owner on Jul 24, 2023. It is now read-only.

Commit a81d1b0

Browse files
committed
all: introduce go-python.{h,c}
1 parent db7434b commit a81d1b0

16 files changed

+610
-180
lines changed

capi.go

+1-3
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,6 @@
11
package python
22

3-
/*
4-
#include "Python.h"
5-
*/
3+
// #include "go-python.h"
64
import "C"
75

86
// PyObject* Py_BuildValue(const char *format, ...)

cgoflags.go

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
package python
22

33
// #cgo pkg-config: python-2.7
4-
// #include "Python.h"
4+
// #include "go-python.h"
55
import "C"
66

77
// EOF

dict.go

+1-5
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,6 @@
11
package python
22

3-
//#include "Python.h"
4-
//#include <stdlib.h>
5-
//#include <string.h>
6-
//int _gopy_PyDict_Check(PyObject *o) { return PyDict_Check(o); }
7-
//int _gopy_PyDict_CheckExact(PyObject *o) { return PyDict_CheckExact(o); }
3+
//#include "go-python.h"
84
import "C"
95

106
import (

exceptions.go

+1-18
Original file line numberDiff line numberDiff line change
@@ -1,23 +1,6 @@
11
package python
22

3-
/*
4-
#include "Python.h"
5-
#include <stdlib.h>
6-
#include <string.h>
7-
8-
// FIXME we should instead have a exceptions_windows.go file...
9-
# ifndef WIN32
10-
PyObject* PyErr_SetFromWindowsErr(int ierr) { return NULL; }
11-
PyObject* PyErr_SetExcFromWindowsErr(PyObject *type, int ierr) { return NULL; }
12-
PyObject* PyErr_SetFromWindowsErrWithFilename(int ierr, const char *filename) { return NULL; }
13-
PyObject* PyErr_SetExcFromWindowsErrWithFilename(PyObject *type, int ierr, char *filename) { return NULL; }
14-
15-
# endif
16-
17-
int _gopy_PyErr_WarnPy3k(char *message, int stacklevel)
18-
{ return PyErr_WarnPy3k(message, stacklevel);}
19-
20-
*/
3+
// #include "go-python.h"
214
import "C"
225

236
import (

0 commit comments

Comments
 (0)