summaryrefslogtreecommitdiff
path: root/py/modules/IcePy/Communicator.cpp
diff options
context:
space:
mode:
authorMark Spruiell <mes@zeroc.com>2006-01-12 18:40:18 +0000
committerMark Spruiell <mes@zeroc.com>2006-01-12 18:40:18 +0000
commit99e5a32c67cc837800caf2da72f67f7f076f04e6 (patch)
treeb50c03fee4fccdc9a610eac7fc3b4975876d4f97 /py/modules/IcePy/Communicator.cpp
parentfixing SSL cert path (diff)
downloadice-99e5a32c67cc837800caf2da72f67f7f076f04e6.tar.bz2
ice-99e5a32c67cc837800caf2da72f67f7f076f04e6.tar.xz
ice-99e5a32c67cc837800caf2da72f67f7f076f04e6.zip
return remaining args to caller
Diffstat (limited to 'py/modules/IcePy/Communicator.cpp')
-rw-r--r--py/modules/IcePy/Communicator.cpp30
1 files changed, 14 insertions, 16 deletions
diff --git a/py/modules/IcePy/Communicator.cpp b/py/modules/IcePy/Communicator.cpp
index 395be689c70..a5b64388546 100644
--- a/py/modules/IcePy/Communicator.cpp
+++ b/py/modules/IcePy/Communicator.cpp
@@ -148,9 +148,8 @@ communicatorInit(CommunicatorObject* self, PyObject* args, PyObject* /*kwds*/)
seq = props->parseIceCommandLineOptions(seq);
//
- // Remaining command line options are passed to the
- // communicator with argc/argv. This is necessary for Ice
- // plugin properties (e.g.: IceSSL).
+ // Remaining command line options are passed to the communicator
+ // as an argument vector in case they contain plugin properties.
//
int argc = seq.size();
char** argv = new char*[argc + 1];
@@ -173,32 +172,31 @@ communicatorInit(CommunicatorObject* self, PyObject* args, PyObject* /*kwds*/)
free(argv[i]);
}
delete[] argv;
-
+
setPythonException(ex);
return -1;
}
-
- for(i = 0; i < argc + 1; ++i)
- {
- free(argv[i]);
- }
- delete[] argv;
//
// Replace the contents of the given argument list with the filtered arguments.
//
if(arglist)
{
- if(PyList_SetSlice(arglist, 0, PyList_Size(arglist), NULL) < 0)
- {
- return -1;
- }
- if(!stringSeqToList(seq, arglist))
+ PyList_SetSlice(arglist, 0, PyList_Size(arglist), NULL); // Clear the list.
+
+ for(i = 0; i < argc; ++i)
{
- return -1;
+ PyObjectHandle str = Py_BuildValue(STRCAST("s"), argv[i]);
+ PyList_Append(arglist, str.get());
}
}
+ for(i = 0; i < argc + 1; ++i)
+ {
+ free(argv[i]);
+ }
+ delete[] argv;
+
self->communicator = new Ice::CommunicatorPtr(communicator);
ObjectFactoryPtr factory = new ObjectFactory;
(*self->communicator)->addObjectFactory(factory, "");