diff options
author | Armin Rigo <arigo@tunes.org> | 2016-01-15 11:26:44 +0100 |
---|---|---|
committer | Armin Rigo <arigo@tunes.org> | 2016-01-15 11:26:44 +0100 |
commit | ca8c5b6c3a04b9beeab8a03dfe22c0f22c3f1d2a (patch) | |
tree | 88bf66eef993556c412b04e9bacd853e67969d64 /c/cffi1_module.c | |
parent | b9b8891ab31243ad231b09da55e2be86d250e33f (diff) | |
parent | 921ae175c64b8dba9418a10e8eed0b9729cd2156 (diff) | |
download | cffi-ca8c5b6c3a04b9beeab8a03dfe22c0f22c3f1d2a.tar.gz |
hg merge static-callback-embedding
Embedding!
Diffstat (limited to 'c/cffi1_module.c')
-rw-r--r-- | c/cffi1_module.c | 9 |
1 files changed, 8 insertions, 1 deletions
diff --git a/c/cffi1_module.c b/c/cffi1_module.c index a6b896e..bf309f6 100644 --- a/c/cffi1_module.c +++ b/c/cffi1_module.c @@ -3,7 +3,7 @@ #include "realize_c_type.c" #define CFFI_VERSION_MIN 0x2601 -#define CFFI_VERSION_MAX 0x26FF +#define CFFI_VERSION_MAX 0x27FF typedef struct FFIObject_s FFIObject; typedef struct LibObject_s LibObject; @@ -214,5 +214,12 @@ static PyObject *b_init_cffi_1_0_external_module(PyObject *self, PyObject *arg) (PyObject *)lib) < 0) return NULL; +#if PY_MAJOR_VERSION >= 3 + /* add manually 'module_name' in sys.modules: it seems that + Py_InitModule() is not enough to do that */ + if (PyDict_SetItemString(modules_dict, module_name, m) < 0) + return NULL; +#endif + return m; } |