search for: py_initmodule

Displaying 9 results from an estimated 9 matches for "py_initmodule".

2016 May 05
1
[PATCH] python: use constants instead of raw values
...uestfs-py-byhand.c | 7 +++++++ python/guestfs-py.h | 2 ++ 3 files changed, 14 insertions(+), 2 deletions(-) diff --git a/generator/python.ml b/generator/python.ml index 9744b8f..470abe7 100644 --- a/generator/python.ml +++ b/generator/python.ml @@ -597,6 +597,9 @@ moduleinit (void) m = Py_InitModule ((char *) \"libguestfsmod\", methods); #endif + if (m != NULL) + guestfs_int_py_extend_module (m); + return m; /* m might be NULL if module init failed */ } @@ -719,9 +722,9 @@ class GuestFS(object): \"\"\" flags = 0 if not environmen...
2009 Jan 31
0
[LLVMdev] -O4 -fvisibility=hidden
...n.cc 2009-01-30 22:23:36.000000000 -0500 @@ -3566,6 +3566,9 @@ // Initialization routine called by python when module is dynamically loaded. // extern "C" void initspy() +__attribute__((visibility("default"))); + +extern "C" void initspy() { this_module = Py_InitModule("spy", sparky_methods); Py_XINCREF(this_module); Tk/Python driven software appears very friendly to -fvisibility=hidden. Are there any particular optimization options that one should use besides -O4 -fvisibility=hidden to enable all of the possible llvm Link Time Optimizations? Also,...
2017 Jan 26
0
[nbdkit PATCH v2 5/6] python: Expose nbdkit_set_error to python script
...rror", set_error, METH_VARARGS, + "Store an errno value prior to throwing an exception" }, + { NULL } +}; + /* Is a callback defined? */ static int callback_defined (const char *name, PyObject **obj_rtn) @@ -91,6 +108,7 @@ static void py_load (void) { Py_Initialize (); + Py_InitModule("nbdkit", NbdkitMethods); } static void -- 2.9.3
2009 Jan 31
2
[LLVMdev] -O4 -fvisibility=hidden
On Mon, Jan 26, 2009 at 09:57:28AM -0800, Devang Patel wrote: > Hi Jack, > > On Jan 25, 2009, at 10:00 AM, Jack Howarth wrote: > > > Doing that changes the error messages into a bus > > error on the darwin linker. > > > Pl. file bugzilla report (or radar) with a reproducible test case so > that we can investigate this linker crash. > > As you
2019 Sep 11
0
[PATCH nbdkit] python: Drop support for Python 2.
...PyModuleDef_HEAD_INIT, "nbdkit", @@ -234,25 +221,18 @@ static struct PyModuleDef moduledef = { NULL, NULL }; -#endif static PyMODINIT_FUNC create_nbdkit_module (void) { PyObject *m; -#if PY_MAJOR_VERSION >= 3 m = PyModule_Create (&moduledef); -#else - m = Py_InitModule ("nbdkit", NbdkitMethods); -#endif if (m == NULL) { nbdkit_error ("could not create the nbdkit API module"); exit (EXIT_FAILURE); } -#if PY_MAJOR_VERSION >= 3 return m; -#endif } static void @@ -276,13 +256,8 @@ py_dump_plugin (void) PyObject *fn;...
2019 Sep 11
3
[PATCH nbdkit] python: Drop support for Python 2.
This patch proposes to drop support for Python 2 in nbdkit. Rather than abruptly drop it everywhere, my proposal is that we point people to nbdkit 1.14 (the current stable version) if they want to continue with Python 2 plugins, while gently reminding them of the upcoming Python 2.7 end of life announcement. Libnbd never supported Python 2. Libguestfs in theory supports Python 2 but I dropped
2017 Jan 26
10
[nbdkit PATCH v2 0/6] bind .zero to Python
Fix some things I noticed while reviewing v1, and follow Rich's idea to add a new nbdkit_set_error() utility function with a binding for Python users to request a particular error (rather than being forced to live with whatever stale value is in errno after all the intermediate binding glue code). I could not easily find out how to register a C function callable from perl bindings, and have
2010 Sep 09
2
[PATCH]: add libxl python binding
...+ NULL, /* tp_alloc */ + PyXl_new, /* tp_new */ +}; + +static PyMethodDef xl_methods[] = { { NULL } }; + +PyMODINIT_FUNC initxl(void) +{ + PyObject *m; + + if (PyType_Ready(&PyXlType) < 0) + return; + + m = Py_InitModule(PKG, xl_methods); + + if (m == NULL) + return; + + xl_error_obj = PyErr_NewException(PKG ".Error", PyExc_RuntimeError, NULL); + + Py_INCREF(&PyXlType); + PyModule_AddObject(m, CLS, (PyObject *)&PyXlType); + + Py_INCREF(xl_error_obj); + PyModule_AddObject(m,...
2017 Jan 27
6
[nbdkit PATCH v3 0/4] bind .zero to Python
This cleans up the existing code base with regards to implicit use of errno from language bindings, then rebases the previous work in python on top of that. I'm still playing with the perl bindings, but got further after reading 'perldoc perlembed'. Eric Blake (4): plugins: Don't use bogus errno from non-C plugins plugins: Add new nbdkit_set_error() utility function python: