From 50a8b9ea0c4a819073b46449dee8fc839b837ae5 Mon Sep 17 00:00:00 2001 From: Martin Sustrik Date: Sun, 20 Sep 2009 10:14:21 +0200 Subject: 'flags' parameter added to zmq_init --- bindings/python/pyzmq.cpp | 13 ++++++++----- 1 file changed, 8 insertions(+), 5 deletions(-) (limited to 'bindings/python/pyzmq.cpp') diff --git a/bindings/python/pyzmq.cpp b/bindings/python/pyzmq.cpp index 4bb5653..32f30fe 100644 --- a/bindings/python/pyzmq.cpp +++ b/bindings/python/pyzmq.cpp @@ -53,15 +53,16 @@ int context_init (context_t *self, PyObject *args, PyObject *kwdict) { int app_threads; int io_threads; - static const char *kwlist [] = {"app_threads", "io_threads", NULL}; - if (!PyArg_ParseTupleAndKeywords (args, kwdict, "ii", (char**) kwlist, - &app_threads, &io_threads)) { + int flags = 0; + static const char *kwlist [] = {"app_threads", "io_threads", "flags", NULL}; + if (!PyArg_ParseTupleAndKeywords (args, kwdict, "ii|i", (char**) kwlist, + &app_threads, &io_threads, &flags)) { PyErr_SetString (PyExc_SystemError, "invalid arguments"); return -1; } assert (!self->handle); - self->handle = zmq_init (app_threads, io_threads); + self->handle = zmq_init (app_threads, io_threads, flags); if (!self->handle) { PyErr_SetString (PyExc_SystemError, strerror (errno)); return -1; @@ -522,7 +523,9 @@ PyMODINIT_FUNC initlibpyzmq () t = PyInt_FromLong (ZMQ_MCAST_LOOP); PyDict_SetItemString (dict, "MCAST_LOOP", t); Py_DECREF (t); - + t = PyInt_FromLong (ZMQ_POLL); + PyDict_SetItemString (dict, "POLL", t); + Py_DECREF (t); } #if defined _MSC_VER -- cgit v1.2.3