search for: pymodinit_func

Displaying 14 results from an estimated 14 matches for "pymodinit_func".

2020 Mar 23
2
Re: [PATCH nbdkit 3/3] python: Remove extraneous static keyword
...deletion(-) > > diff --git a/plugins/python/python.c b/plugins/python/python.c > index a1a0438b..adc1aaa5 100644 > --- a/plugins/python/python.c > +++ b/plugins/python/python.c > @@ -224,7 +224,7 @@ static struct PyModuleDef moduledef = { > NULL > }; > > -static PyMODINIT_FUNC > +PyMODINIT_FUNC > create_nbdkit_module (void) > { > PyObject *m; > -- I don't believe this is correct. We call PyImport_AppendInittab ("nbdkit", create_nbdkit_module); later on so the function shouldn't need to public. What's the actual error when...
2009 Jan 31
0
[LLVMdev] -O4 -fvisibility=hidden
...ild sparky (http://www.cgl.ucsf.edu/home/sparky/) at -O4 under llvm-gcc-4.2 and llvm-g++-4.2 on darwin with minor patches... --- sparky/c++/_tkinter.c.orig 2009-01-30 22:14:28.000000000 -0500 +++ sparky/c++/_tkinter.c 2009-01-30 22:16:40.000000000 -0500 @@ -3089,6 +3089,9 @@ } } +PyMODINIT_FUNC +init_tkinter(void) +__attribute__((visibility("default"))); PyMODINIT_FUNC init_tkinter(void) --- sparky/c++/python.cc.orig 2009-01-30 22:23:07.000000000 -0500 +++ sparky/c++/python.cc 2009-01-30 22:23:36.000000000 -0500 @@ -3566,6 +3566,9 @@ // Initialization routine calle...
2020 Mar 23
0
[PATCH nbdkit 3/3] python: Remove extraneous static keyword
...ython.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/plugins/python/python.c b/plugins/python/python.c index a1a0438b..adc1aaa5 100644 --- a/plugins/python/python.c +++ b/plugins/python/python.c @@ -224,7 +224,7 @@ static struct PyModuleDef moduledef = { NULL }; -static PyMODINIT_FUNC +PyMODINIT_FUNC create_nbdkit_module (void) { PyObject *m; -- 2.25.0
2019 Jun 28
3
[PATCH libnbd v2] python: Raise a custom exception containing error string and errno.
This kind of fixes the problems in v1. The exception still primarily lives in the libnbdmod and you could still refer to it using libnbdmod.Error (but don't do that). However when the exception is printed it now appears as nbd.Error, and you can catch it also using the same name. Other problems: - There is no "nice" interface to accessing the exception fields. You have to use
2020 Mar 23
0
Re: [PATCH nbdkit 3/3] python: Remove extraneous static keyword
...ugins/python/python.c b/plugins/python/python.c > > index a1a0438b..adc1aaa5 100644 > > --- a/plugins/python/python.c > > +++ b/plugins/python/python.c > > @@ -224,7 +224,7 @@ static struct PyModuleDef moduledef = { > > NULL > > }; > > > > -static PyMODINIT_FUNC > > +PyMODINIT_FUNC > > create_nbdkit_module (void) > > { > > PyObject *m; > > -- > > I don't believe this is correct. We call > > PyImport_AppendInittab ("nbdkit", create_nbdkit_module); > > later on so the function shouldn'...
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 Jun 28
0
[PATCH libnbd v2] python: Raise a custom exception containing error string and errno.
...1, PyLong_FromLong (nbd_get_errno ())); + PyErr_SetObject (nbd_internal_py_Error, args); +} + "; List.iter ( @@ -3390,6 +3403,9 @@ static struct PyModuleDef moduledef = { NULL, /* m_free */ }; +/* nbd.Error exception. */ +PyObject *nbd_internal_py_Error; + extern PyMODINIT_FUNC PyInit_libnbdmod (void); PyMODINIT_FUNC @@ -3401,6 +3417,19 @@ PyInit_libnbdmod (void) if (mod == NULL) return NULL; + nbd_internal_py_Error = PyErr_NewExceptionWithDoc ( + \"nbd.Error\", + \"Exception thrown when the underlying libnbd call fails. This\\n\"...
2019 Jun 28
1
[PATCH libnbd] python: Raise a custom exception containing error string and errno.
I spent a good few hours this morning trying to make this work and came up with the following patch. It's not quite right though. The exception I've created exists in the libnbdmod module (ie. the underlying C module that we use for the Python bindings). Ideally we'd define and throw an exception from the normal nbd module, but I couldn't work out how to do that. Probably
2019 Jun 28
0
[PATCH libnbd v3] python: Raise a custom exception containing error string and errno.
...1, PyLong_FromLong (nbd_get_errno ())); + PyErr_SetObject (nbd_internal_py_Error, args); +} + "; List.iter ( @@ -3390,6 +3403,9 @@ static struct PyModuleDef moduledef = { NULL, /* m_free */ }; +/* nbd.Error exception. */ +PyObject *nbd_internal_py_Error; + extern PyMODINIT_FUNC PyInit_libnbdmod (void); PyMODINIT_FUNC @@ -3401,6 +3417,11 @@ PyInit_libnbdmod (void) if (mod == NULL) return NULL; + nbd_internal_py_Error = PyErr_NewException (\"nbd.Error\", NULL, NULL); + if (nbd_internal_py_Error == NULL) + return NULL; + PyModule_AddObject (mod,...
2020 Mar 23
6
[PATCH nbdkit 0/3] msys2 support for review
I pushed a few of the msys2 patches upstream. I changed the way that $(SHARED_LDFLAGS) works so it's more to my liking, and the others were pushed unchanged. Three patches remain which I'm posting on the mailing list for proper review. Rich.
2019 Jun 28
3
[PATCH libnbd v3] python: Raise a custom exception containing error string and errno.
Following Eric's suggestions from v2, this adds .string, .errno and .__str__ properties. The .string property returns the error string. The .errno property returns the errno (from the errno module), or None. The __str__ property makes the exception nicely printable. Rich.
2019 Sep 11
0
[PATCH nbdkit] python: Drop support for Python 2.
...-222,7 +210,6 @@ check_python_failure (const char *callback) return 0; } -#if PY_MAJOR_VERSION >= 3 static struct PyModuleDef moduledef = { 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 (EX...
2010 Sep 09
2
[PATCH]: add libxl python binding
...t.h> +#include <arpa/inet.h> +#include <xenctrl.h> +#include <ctype.h> +#include <inttypes.h> + + +#include <libxl.h> +#include <libxl_utils.h> + +#define ARRAY_SIZE(x) (sizeof(x) / sizeof((x)[0])) + +/* Needed for Python versions earlier than 2.3. */ +#ifndef PyMODINIT_FUNC +#define PyMODINIT_FUNC DL_EXPORT(void) +#endif + +#define CLS "ctx" + +static PyObject *xl_error_obj; + +static int fixed_bytearray_set(PyObject *v, uint8_t *ptr, size_t len) +{ + char *tmp; + size_t sz; + + if ( NULL == v ) { + memset(ptr, 0, len); + return 0; +...
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