[34045] trunk/dports/devel/ice-python
blair at macports.org
blair at macports.org
Sun Feb 10 19:56:12 PST 2008
Revision: 34045
http://trac.macosforge.org/projects/macports/changeset/34045
Author: blair at macports.org
Date: 2008-02-10 19:56:11 -0800 (Sun, 10 Feb 2008)
Log Message:
-----------
ice-python: fix patch filenames to match policy.
Modified Paths:
--------------
trunk/dports/devel/ice-python/Portfile
Added Paths:
-----------
trunk/dports/devel/ice-python/files/patch-ServantLocator.locate-can-throw-user-exceptions.diff
trunk/dports/devel/ice-python/files/patch-config.Make.rules.Darwin.diff
trunk/dports/devel/ice-python/files/patch-config.Make.rules.diff
Removed Paths:
-------------
trunk/dports/devel/ice-python/files/patch-ServantLocator.locate-can-throw-user-exceptions
trunk/dports/devel/ice-python/files/patch-config.Make.rules
trunk/dports/devel/ice-python/files/patch-config.Make.rules.Darwin
Modified: trunk/dports/devel/ice-python/Portfile
===================================================================
--- trunk/dports/devel/ice-python/Portfile 2008-02-11 03:49:47 UTC (rev 34044)
+++ trunk/dports/devel/ice-python/Portfile 2008-02-11 03:56:11 UTC (rev 34045)
@@ -38,9 +38,9 @@
depends_lib port:python24 \
port:ice-cpp
-patchfiles patch-config.Make.rules \
- patch-config.Make.rules.Darwin \
- patch-ServantLocator.locate-can-throw-user-exceptions
+patchfiles patch-config.Make.rules.diff \
+ patch-config.Make.rules.Darwin.diff \
+ patch-ServantLocator.locate-can-throw-user-exceptions.diff
use_configure no
Deleted: trunk/dports/devel/ice-python/files/patch-ServantLocator.locate-can-throw-user-exceptions
===================================================================
--- trunk/dports/devel/ice-python/files/patch-ServantLocator.locate-can-throw-user-exceptions 2008-02-11 03:49:47 UTC (rev 34044)
+++ trunk/dports/devel/ice-python/files/patch-ServantLocator.locate-can-throw-user-exceptions 2008-02-11 03:56:11 UTC (rev 34045)
@@ -1,969 +0,0 @@
-diff -ru ../IcePy-3.2.1.orig/modules/IcePy/Communicator.cpp ./modules/IcePy/Communicator.cpp
---- ../IcePy-3.2.1.orig/modules/IcePy/Communicator.cpp 2007-08-08 12:00:54.000000000 -0700
-+++ ./modules/IcePy/Communicator.cpp 2007-12-21 16:59:17.000000000 -0800
-@@ -161,11 +161,18 @@
- {
- data.threadHook = new ThreadNotificationWrapper(threadHook.get());
- }
-+ }
-
-+ try
-+ {
-+ data.properties = Ice::createProperties(seq, data.properties);
-+ }
-+ catch(const Ice::Exception& ex)
-+ {
-+ setPythonException(ex);
-+ return -1;
- }
-
-- data.properties = Ice::createProperties(seq, data.properties);
--
- //
- // Disable collocation optimization, otherwise a Python invocation on
- // a collocated servant results in a CollocationOptimizationException
-@@ -200,7 +207,7 @@
- }
- catch(const Ice::Exception& ex)
- {
-- for(i = 0; i < argc + 1; ++i)
-+ for(i = 0; i < argc; ++i)
- {
- free(argv[i]);
- }
-@@ -224,7 +231,7 @@
- }
- }
-
-- for(i = 0; i < argc + 1; ++i)
-+ for(i = 0; i < argc; ++i)
- {
- free(argv[i]);
- }
-diff -ru ../IcePy-3.2.1.orig/modules/IcePy/.depend ./modules/IcePy/.depend
---- ../IcePy-3.2.1.orig/modules/IcePy/.depend 2007-08-08 12:00:54.000000000 -0700
-+++ ./modules/IcePy/.depend 2007-12-21 16:59:17.000000000 -0800
-@@ -1,15 +1,15 @@
--Communicator$(OBJEXT): Communicator.cpp Communicator.h Config.h ImplicitContext.h Logger.h Util.h ObjectAdapter.h ObjectFactory.h Properties.h Proxy.h ThreadNotification.h
--Connection$(OBJEXT): Connection.cpp Connection.h Config.h ObjectAdapter.h Proxy.h Util.h
--Current$(OBJEXT): Current.cpp Current.h Config.h Connection.h ObjectAdapter.h Util.h
--ImplicitContext$(OBJEXT): ImplicitContext.cpp ImplicitContext.h Config.h ObjectAdapter.h Proxy.h Util.h
--Init$(OBJEXT): Init.cpp Communicator.h Config.h Connection.h Current.h ImplicitContext.h Logger.h Util.h ObjectAdapter.h Operation.h Properties.h Proxy.h Slice.h Types.h
--Logger$(OBJEXT): Logger.cpp Logger.h Config.h Util.h
--ObjectAdapter$(OBJEXT): ObjectAdapter.cpp ObjectAdapter.h Config.h Communicator.h Current.h Operation.h Proxy.h Util.h
--ObjectFactory$(OBJEXT): ObjectFactory.cpp ObjectFactory.h Config.h Types.h Util.h
--Operation$(OBJEXT): Operation.cpp Operation.h Config.h Current.h Proxy.h Types.h Util.h
--Properties$(OBJEXT): Properties.cpp Properties.h Config.h Util.h
--Proxy$(OBJEXT): Proxy.cpp Proxy.h Config.h Communicator.h Connection.h Util.h
--Slice$(OBJEXT): Slice.cpp Slice.h Config.h Util.h
--ThreadNotification$(OBJEXT): ThreadNotification.cpp ThreadNotification.h Config.h Util.h
--Types$(OBJEXT): Types.cpp Types.h Config.h Util.h Current.h Proxy.h
--Util$(OBJEXT): Util.cpp Util.h Config.h
-+Communicator$(OBJEXT): Communicator.cpp ./Communicator.h ./Config.h ./ImplicitContext.h ./Logger.h ./Util.h ./ObjectAdapter.h ./ObjectFactory.h ./Properties.h ./Proxy.h ./ThreadNotification.h
-+Connection$(OBJEXT): Connection.cpp ./Connection.h ./Config.h ./ObjectAdapter.h ./Proxy.h ./Util.h
-+Current$(OBJEXT): Current.cpp ./Current.h ./Config.h ./Connection.h ./ObjectAdapter.h ./Util.h
-+ImplicitContext$(OBJEXT): ImplicitContext.cpp ./ImplicitContext.h ./Config.h ./ObjectAdapter.h ./Proxy.h ./Util.h
-+Init$(OBJEXT): Init.cpp ./Communicator.h ./Config.h ./Connection.h ./Current.h ./ImplicitContext.h ./Logger.h ./Util.h ./ObjectAdapter.h ./Operation.h ./Properties.h ./Proxy.h ./Slice.h ./Types.h
-+Logger$(OBJEXT): Logger.cpp ./Logger.h ./Config.h ./Util.h
-+ObjectAdapter$(OBJEXT): ObjectAdapter.cpp ./ObjectAdapter.h ./Config.h ./Communicator.h ./Current.h ./Operation.h ./Proxy.h ./Types.h ./Util.h
-+ObjectFactory$(OBJEXT): ObjectFactory.cpp ./ObjectFactory.h ./Config.h ./Types.h ./Util.h
-+Operation$(OBJEXT): Operation.cpp ./Operation.h ./Config.h ./Current.h ./Proxy.h ./Types.h ./Util.h
-+Properties$(OBJEXT): Properties.cpp ./Properties.h ./Config.h ./Util.h
-+Proxy$(OBJEXT): Proxy.cpp ./Proxy.h ./Config.h ./Communicator.h ./Connection.h ./Operation.h ./Util.h
-+Slice$(OBJEXT): Slice.cpp ./Slice.h ./Config.h ./Util.h
-+ThreadNotification$(OBJEXT): ThreadNotification.cpp ./ThreadNotification.h ./Config.h ./Util.h
-+Types$(OBJEXT): Types.cpp ./Types.h ./Config.h ./Util.h ./Current.h ./Proxy.h
-+Util$(OBJEXT): Util.cpp ./Util.h ./Config.h
-diff -ru ../IcePy-3.2.1.orig/modules/IcePy/ObjectAdapter.cpp ./modules/IcePy/ObjectAdapter.cpp
---- ../IcePy-3.2.1.orig/modules/IcePy/ObjectAdapter.cpp 2007-08-08 12:00:54.000000000 -0700
-+++ ./modules/IcePy/ObjectAdapter.cpp 2007-12-21 16:59:17.000000000 -0800
-@@ -15,6 +15,7 @@
- #include <Current.h>
- #include <Operation.h>
- #include <Proxy.h>
-+#include <Types.h>
- #include <Util.h>
- #include <Ice/Communicator.h>
- #include <Ice/LocalException.h>
-@@ -226,7 +227,21 @@
- PyObjectHandle res = PyObject_CallMethod(_locator, STRCAST("locate"), STRCAST("O"), c->current);
- if(PyErr_Occurred())
- {
-- throwPythonException();
-+ PyException ex;
-+
-+ PyObject* userExceptionType = lookupType("Ice.UserException");
-+ if(PyObject_IsInstance(ex.ex.get(), userExceptionType))
-+ {
-+ PyObjectHandle iceType = PyObject_GetAttrString(ex.ex.get(), STRCAST("ice_type"));
-+ assert(iceType.get());
-+ ExceptionInfoPtr info = ExceptionInfoPtr::dynamicCast(getException(iceType.get()));
-+ assert(info);
-+ info->raise(ex.ex.get(), current.adapter->getCommunicator());
-+ }
-+ else
-+ {
-+ ex.raise();
-+ }
- }
-
- if(res.get() == Py_None)
-@@ -274,7 +289,8 @@
- }
-
- void
--IcePy::ServantLocatorWrapper::finished(const Ice::Current&, const Ice::ObjectPtr&, const Ice::LocalObjectPtr& cookie)
-+IcePy::ServantLocatorWrapper::finished(const Ice::Current& current, const Ice::ObjectPtr&,
-+ const Ice::LocalObjectPtr& cookie)
- {
- CookiePtr c = CookiePtr::dynamicCast(cookie);
- assert(c);
-@@ -286,7 +302,21 @@
- servantObj.get(), c->cookie);
- if(PyErr_Occurred())
- {
-- throwPythonException();
-+ PyException ex;
-+
-+ PyObject* userExceptionType = lookupType("Ice.UserException");
-+ if(PyObject_IsInstance(ex.ex.get(), userExceptionType))
-+ {
-+ PyObjectHandle iceType = PyObject_GetAttrString(ex.ex.get(), STRCAST("ice_type"));
-+ assert(iceType.get());
-+ ExceptionInfoPtr info = ExceptionInfoPtr::dynamicCast(getException(iceType.get()));
-+ assert(info);
-+ info->raise(ex.ex.get(), current.adapter->getCommunicator());
-+ }
-+ else
-+ {
-+ ex.raise();
-+ }
- }
- }
-
-diff -ru ../IcePy-3.2.1.orig/modules/IcePy/Operation.cpp ./modules/IcePy/Operation.cpp
---- ../IcePy-3.2.1.orig/modules/IcePy/Operation.cpp 2007-08-08 12:00:54.000000000 -0700
-+++ ./modules/IcePy/Operation.cpp 2007-12-21 16:59:17.000000000 -0800
-@@ -50,6 +50,7 @@
-
- OperationI(const char*, PyObject*, PyObject*, int, PyObject*, PyObject*, PyObject*, PyObject*, PyObject*);
-
-+ virtual PyObject* invoke(const Ice::ObjectPrx&, PyObject*);
- virtual PyObject* invoke(const Ice::ObjectPrx&, PyObject*, PyObject*);
- virtual PyObject* invokeAsync(const Ice::ObjectPrx&, PyObject*, PyObject*, PyObject*);
- virtual void deprecate(const string&);
-@@ -476,6 +477,37 @@
- }
-
- PyObject*
-+IcePy::OperationI::invoke(const Ice::ObjectPrx& proxy, PyObject* args)
-+{
-+ //
-+ // This method is used when the optional context argument may be included in the args tuple.
-+ //
-+
-+ assert(PyTuple_Check(args));
-+
-+ PyObject* ctx = Py_None;
-+
-+ PyObjectHandle slice;
-+ if(PyTuple_GET_SIZE(args) > static_cast<Py_ssize_t>(_inParams.size()))
-+ {
-+ ctx = PyTuple_GET_ITEM(args, PyTuple_GET_SIZE(args) - 1);
-+ if(ctx != Py_None && !PyDict_Check(ctx))
-+ {
-+ PyErr_Format(PyExc_ValueError, STRCAST("context argument must be None or a dictionary"));
-+ return 0;
-+ }
-+ slice = PyTuple_GetSlice(args, 0, PyTuple_GET_SIZE(args) - 1);
-+ }
-+ else
-+ {
-+ slice = args;
-+ Py_INCREF(args);
-+ }
-+
-+ return invoke(proxy, slice.get(), ctx);
-+}
-+
-+PyObject*
- IcePy::OperationI::invoke(const Ice::ObjectPrx& proxy, PyObject* args, PyObject* pyctx)
- {
- Ice::CommunicatorPtr communicator = proxy->ice_getCommunicator();
-@@ -991,6 +1023,9 @@
- else
- {
- Ice::OutputStreamPtr os = Ice::createOutputStream(communicator);
-+
-+ os->writeBool(info->usesClasses);
-+
- ObjectMap objectMap;
- info->marshal(ex.ex.get(), os, &objectMap);
-
-diff -ru ../IcePy-3.2.1.orig/modules/IcePy/Operation.h ./modules/IcePy/Operation.h
---- ../IcePy-3.2.1.orig/modules/IcePy/Operation.h 2007-08-08 12:00:54.000000000 -0700
-+++ ./modules/IcePy/Operation.h 2007-12-21 16:59:17.000000000 -0800
-@@ -24,6 +24,7 @@
-
- virtual ~Operation();
-
-+ virtual PyObject* invoke(const Ice::ObjectPrx&, PyObject*) = 0;
- virtual PyObject* invoke(const Ice::ObjectPrx&, PyObject*, PyObject*) = 0;
- virtual PyObject* invokeAsync(const Ice::ObjectPrx&, PyObject*, PyObject*, PyObject*) = 0;
- virtual void deprecate(const std::string&) = 0;
-diff -ru ../IcePy-3.2.1.orig/modules/IcePy/Proxy.cpp ./modules/IcePy/Proxy.cpp
---- ../IcePy-3.2.1.orig/modules/IcePy/Proxy.cpp 2007-08-08 12:00:54.000000000 -0700
-+++ ./modules/IcePy/Proxy.cpp 2007-12-21 16:59:17.000000000 -0800
-@@ -15,6 +15,7 @@
- #include <structmember.h>
- #include <Communicator.h>
- #include <Connection.h>
-+#include <Operation.h>
- #include <Util.h>
- #include <Ice/Communicator.h>
- #include <Ice/LocalException.h>
-@@ -220,47 +221,17 @@
- static PyObject*
- proxyIceIsA(ProxyObject* self, PyObject* args)
- {
-- char* type;
-- PyObject* ctx = 0;
-- if(!PyArg_ParseTuple(args, STRCAST("s|O!"), &type, &PyDict_Type, &ctx))
-- {
-- return 0;
-- }
--
- assert(self->proxy);
-
-- bool b;
-- try
-- {
-- AllowThreads allowThreads; // Release Python's global interpreter lock during remote invocations.
-- if(ctx)
-- {
-- Ice::Context context;
-- if(!dictionaryToContext(ctx, context))
-- {
-- return 0;
-- }
-- b = (*self->proxy)->ice_isA(type, context);
-- }
-- else
-- {
-- b = (*self->proxy)->ice_isA(type);
-- }
-- }
-- catch(const Ice::Exception& ex)
-- {
-- setPythonException(ex);
-- return 0;
-- }
-+ PyObject* objectType = lookupType("Ice.Object");
-+ assert(objectType);
-+ PyObjectHandle obj = PyObject_GetAttrString(objectType, "_op_ice_isA");
-+ assert(obj.get());
-
-- if(b)
-- {
-- PyRETURN_TRUE;
-- }
-- else
-- {
-- PyRETURN_FALSE;
-- }
-+ OperationPtr op = getOperation(obj.get());
-+ assert(op);
-+
-+ return op->invoke(*self->proxy, args);
- }
-
- #ifdef WIN32
-@@ -269,39 +240,17 @@
- static PyObject*
- proxyIcePing(ProxyObject* self, PyObject* args)
- {
-- PyObject* ctx = 0;
-- if(!PyArg_ParseTuple(args, STRCAST("|O!"), &PyDict_Type, &ctx))
-- {
-- return 0;
-- }
--
- assert(self->proxy);
-
-- try
-- {
-- AllowThreads allowThreads; // Release Python's global interpreter lock during remote invocations.
-- if(ctx)
-- {
-- Ice::Context context;
-- if(!dictionaryToContext(ctx, context))
-- {
-- return 0;
-- }
-- (*self->proxy)->ice_ping(context);
-- }
-- else
-- {
-- (*self->proxy)->ice_ping();
-- }
-- }
-- catch(const Ice::Exception& ex)
-- {
-- setPythonException(ex);
-- return 0;
-- }
-+ PyObject* objectType = lookupType("Ice.Object");
-+ assert(objectType);
-+ PyObjectHandle obj = PyObject_GetAttrString(objectType, "_op_ice_ping");
-+ assert(obj.get());
-
-- Py_INCREF(Py_None);
-- return Py_None;
-+ OperationPtr op = getOperation(obj.get());
-+ assert(op);
-+
-+ return op->invoke(*self->proxy, args);
- }
-
- #ifdef WIN32
-@@ -310,45 +259,17 @@
- static PyObject*
- proxyIceIds(ProxyObject* self, PyObject* args)
- {
-- PyObject* ctx = 0;
-- if(!PyArg_ParseTuple(args, STRCAST("|O!"), &PyDict_Type, &ctx))
-- {
-- return 0;
-- }
--
- assert(self->proxy);
-
-- Ice::StringSeq ids;
-- try
-- {
-- AllowThreads allowThreads; // Release Python's global interpreter lock during remote invocations.
-- if(ctx)
-- {
-- Ice::Context context;
-- if(!dictionaryToContext(ctx, context))
-- {
-- return 0;
-- }
-- ids = (*self->proxy)->ice_ids(context);
-- }
-- else
-- {
-- ids = (*self->proxy)->ice_ids();
-- }
-- }
-- catch(const Ice::Exception& ex)
-- {
-- setPythonException(ex);
-- return 0;
-- }
-+ PyObject* objectType = lookupType("Ice.Object");
-+ assert(objectType);
-+ PyObjectHandle obj = PyObject_GetAttrString(objectType, "_op_ice_ids");
-+ assert(obj.get());
-
-- PyObject* list = PyList_New(0);
-- if(!list || !stringSeqToList(ids, list))
-- {
-- return 0;
-- }
-+ OperationPtr op = getOperation(obj.get());
-+ assert(op);
-
-- return list;
-+ return op->invoke(*self->proxy, args);
- }
-
- #ifdef WIN32
-@@ -357,39 +278,17 @@
- static PyObject*
- proxyIceId(ProxyObject* self, PyObject* args)
- {
-- PyObject* ctx = 0;
-- if(!PyArg_ParseTuple(args, STRCAST("|O!"), &PyDict_Type, &ctx))
-- {
-- return 0;
-- }
--
- assert(self->proxy);
-
-- string id;
-- try
-- {
-- AllowThreads allowThreads; // Release Python's global interpreter lock during remote invocations.
-- if(ctx)
-- {
-- Ice::Context context;
-- if(!dictionaryToContext(ctx, context))
-- {
-- return 0;
-- }
-- id = (*self->proxy)->ice_id(context);
-- }
-- else
-- {
-- id = (*self->proxy)->ice_id();
-- }
-- }
-- catch(const Ice::Exception& ex)
-- {
-- setPythonException(ex);
-- return 0;
-- }
-+ PyObject* objectType = lookupType("Ice.Object");
-+ assert(objectType);
-+ PyObjectHandle obj = PyObject_GetAttrString(objectType, "_op_ice_id");
-+ assert(obj.get());
-+
-+ OperationPtr op = getOperation(obj.get());
-+ assert(op);
-
-- return Py_BuildValue(STRCAST("s"), id.c_str());
-+ return op->invoke(*self->proxy, args);
- }
-
- #ifdef WIN32
-diff -ru ../IcePy-3.2.1.orig/modules/IcePy/Types.cpp ./modules/IcePy/Types.cpp
---- ../IcePy-3.2.1.orig/modules/IcePy/Types.cpp 2007-08-08 12:00:54.000000000 -0700
-+++ ./modules/IcePy/Types.cpp 2007-12-21 16:59:30.000000000 -0800
-@@ -16,6 +16,8 @@
- #include <Util.h>
- #include <IceUtil/InputUtil.h>
- #include <IceUtil/ScopedArray.h>
-+#include <Ice/BasicStream.h>
-+#include <Ice/Initialize.h>
- #include <Ice/LocalException.h>
-
- using namespace std;
-@@ -2284,6 +2286,116 @@
- }
- }
-
-+namespace
-+{
-+
-+//
-+// Subclass of UserException that wraps a Python user exception.
-+//
-+class UserExceptionWrapper : public Ice::UserException
-+{
-+public:
-+
-+ UserExceptionWrapper(PyObject*, const ExceptionInfoPtr&, const Ice::CommunicatorPtr&);
-+ virtual ~UserExceptionWrapper() throw();
-+
-+ virtual string ice_name() const;
-+ virtual Ice::Exception* ice_clone() const;
-+ virtual void ice_throw() const;
-+
-+ virtual void __write(IceInternal::BasicStream*) const;
-+ virtual void __read(IceInternal::BasicStream*, bool);
-+
-+ virtual bool __usesClasses() const;
-+
-+private:
-+
-+ PyObjectHandle _ex;
-+ ExceptionInfoPtr _info;
-+ Ice::CommunicatorPtr _communicator;
-+};
-+
-+UserExceptionWrapper::UserExceptionWrapper(PyObject* ex, const ExceptionInfoPtr& info,
-+ const Ice::CommunicatorPtr& communicator) :
-+ _ex(ex), _info(info), _communicator(communicator)
-+{
-+ Py_INCREF(ex);
-+}
-+
-+UserExceptionWrapper::~UserExceptionWrapper() throw()
-+{
-+ AdoptThread adoptThread; // Ensure the current thread is able to call into Python.
-+
-+ _ex = 0;
-+}
-+
-+string
-+UserExceptionWrapper::ice_name() const
-+{
-+ return _info->id;
-+}
-+
-+Ice::Exception*
-+UserExceptionWrapper::ice_clone() const
-+{
-+ return new UserExceptionWrapper(*this);
-+}
-+
-+void
-+UserExceptionWrapper::ice_throw() const
-+{
-+ throw *this;
-+}
-+
-+void
-+UserExceptionWrapper::__write(IceInternal::BasicStream* os) const
-+{
-+ AdoptThread adoptThread; // Ensure the current thread is able to call into Python.
-+
-+ //
-+ // To marshal a Python user exception into a BasicStream, we first
-+ // marshal it into an OutputStream and then write the marshaled
-+ // bytes as a blob into the BasicStream.
-+ //
-+ Ice::OutputStreamPtr stream = Ice::createOutputStream(_communicator);
-+
-+ //
-+ // The C++ run time is in charge of marshaling this exception; as such, it has
-+ // already written the "usesClasses" boolean to the stream so we must not
-+ // write it again.
-+ //
-+ ObjectMap objectMap;
-+ _info->marshal(const_cast<PyObject*>(_ex.get()), stream, &objectMap);
-+
-+ //
-+ // It is safe to flush any pending objects here. The C++ run time will also
-+ // flush the pending objects on the BasicStream, but there will never be
-+ // any objects pending on that stream.
-+ //
-+ if(_info->usesClasses)
-+ {
-+ stream->writePendingObjects();
-+ }
-+
-+ Ice::ByteSeq bytes;
-+ stream->finished(bytes);
-+ os->writeBlob(bytes);
-+}
-+
-+void
-+UserExceptionWrapper::__read(IceInternal::BasicStream*, bool)
-+{
-+ assert(false);
-+}
-+
-+bool
-+UserExceptionWrapper::__usesClasses() const
-+{
-+ return _info->usesClasses;
-+}
-+
-+}
-+
- //
- // ExceptionInfo implementation.
- //
-@@ -2296,8 +2408,6 @@
- throw AbortMarshaling();
- }
-
-- os->writeBool(usesClasses);
--
- ExceptionInfoPtr info = this;
- while(info)
- {
-@@ -2405,6 +2515,12 @@
- }
- }
-
-+void
-+IcePy::ExceptionInfo::raise(PyObject* ex, const Ice::CommunicatorPtr& communicator)
-+{
-+ throw UserExceptionWrapper(ex, this, communicator);
-+}
-+
- //
- // lookupClassInfo()
- //
-diff -ru ../IcePy-3.2.1.orig/modules/IcePy/Types.h ./modules/IcePy/Types.h
---- ../IcePy-3.2.1.orig/modules/IcePy/Types.h 2007-08-08 12:00:54.000000000 -0700
-+++ ./modules/IcePy/Types.h 2007-12-21 16:59:17.000000000 -0800
-@@ -356,6 +356,8 @@
- void print(PyObject*, IceUtil::Output&);
- void printMembers(PyObject*, IceUtil::Output&, PrintObjectHistory*);
-
-+ void raise(PyObject*, const Ice::CommunicatorPtr&);
-+
- std::string id;
- ExceptionInfoPtr base;
- DataMemberList members;
-diff -ru ../IcePy-3.2.1.orig/modules/IcePy/Util.cpp ./modules/IcePy/Util.cpp
---- ../IcePy-3.2.1.orig/modules/IcePy/Util.cpp 2007-08-08 12:00:54.000000000 -0700
-+++ ./modules/IcePy/Util.cpp 2007-12-21 16:59:17.000000000 -0800
-@@ -58,7 +58,7 @@
- }
-
- PyObject*
--IcePy::PyObjectHandle::get()
-+IcePy::PyObjectHandle::get() const
- {
- return _p;
- }
-diff -ru ../IcePy-3.2.1.orig/modules/IcePy/Util.h ./modules/IcePy/Util.h
---- ../IcePy-3.2.1.orig/modules/IcePy/Util.h 2007-08-08 12:00:54.000000000 -0700
-+++ ./modules/IcePy/Util.h 2007-12-21 16:59:17.000000000 -0800
-@@ -61,7 +61,7 @@
- void operator=(PyObject*);
- void operator=(const PyObjectHandle&);
-
-- PyObject* get();
-+ PyObject* get() const;
- PyObject* release();
-
- private:
-diff -ru ../IcePy-3.2.1.orig/test/Ice/servantLocator/AllTests.py ./test/Ice/servantLocator/AllTests.py
---- ../IcePy-3.2.1.orig/test/Ice/servantLocator/AllTests.py 2007-08-08 12:00:54.000000000 -0700
-+++ ./test/Ice/servantLocator/AllTests.py 2007-12-21 16:59:17.000000000 -0800
-@@ -18,63 +18,108 @@
-
- try:
- obj.requestFailedException()
-- test(false)
-+ test(False)
- except Ice.ObjectNotExistException, ex:
- if not collocated:
- test(ex.id == obj.ice_getIdentity())
- test(ex.facet == obj.ice_getFacet())
- test(ex.operation == "requestFailedException")
-+ except:
-+ test(False)
-
- try:
- obj.unknownUserException()
-- test(false)
-+ test(False)
- except Ice.UnknownUserException, ex:
- test(ex.unknown == "reason")
-- pass
-+ except:
-+ test(False)
-
- try:
- obj.unknownLocalException()
-- test(false)
-+ test(False)
- except Ice.UnknownLocalException, ex:
- test(ex.unknown == "reason")
-- pass
-+ except:
-+ test(False)
-
- try:
- obj.unknownException()
-- test(false)
-+ test(False)
- except Ice.UnknownException, ex:
- test(ex.unknown == "reason")
- pass
-
- try:
- obj.userException()
-- test(false)
-+ test(False)
- except Ice.UnknownUserException, ex:
-- #print ex.unknown
-- test(not collocated)
-- test(ex.unknown.find("Test.TestIntfUserException") >= 0)
-- except Test.TestIntfUserException:
-- test(collocated)
-+ test(ex.unknown.find("Test::TestIntfUserException") >= 0)
-+ except:
-+ test(False)
-
- try:
- obj.localException()
-- test(false)
-+ test(False)
- except Ice.UnknownLocalException, ex:
-- #print ex.unknown
- test(not collocated)
- test(ex.unknown.find("Ice.SocketException") >= 0)
- except SocketException:
- test(collocated)
-+ except:
-+ test(False)
-
- try:
- obj.pythonException()
-- test(false)
-+ test(False)
- except Ice.UnknownException, ex:
-- #print ex.unknown
-- test(not collocated)
- test(ex.unknown.find("RuntimeError: message") >= 0)
-- except RuntimeError:
-- test(collocated)
-+ except:
-+ test(False)
-+
-+ try:
-+ obj.unknownExceptionWithServantException()
-+ test(False)
-+ except Ice.UnknownException, ex:
-+ test(ex.unknown == "reason")
-+ except:
-+ test(False)
-+
-+ try:
-+ obj.impossibleException(False)
-+ test(False)
-+ except Ice.UnknownUserException:
-+ # Operation doesn't throw, but locate() and finshed() throw TestIntfUserException.
-+ pass
-+ except:
-+ test(False)
-+
-+ try:
-+ obj.impossibleException(True)
-+ test(False)
-+ except Ice.UnknownUserException:
-+ # Operation doesn't throw, but locate() and finshed() throw TestIntfUserException.
-+ pass
-+ except:
-+ test(False)
-+
-+ try:
-+ obj.intfUserException(False)
-+ test(False)
-+ except Test.TestImpossibleException:
-+ # Operation doesn't throw, but locate() and finished() throw TestImpossibleException.
-+ pass
-+ except:
-+ test(False)
-+
-+ try:
-+ obj.intfUserException(True)
-+ test(False)
-+ except Test.TestImpossibleException:
-+ # Operation throws TestIntfUserException, but locate() and finished() throw TestImpossibleException.
-+ pass
-+ except:
-+ test(False)
-
- def allTests(communicator, collocated):
- print "testing stringToProxy... ",
-@@ -90,6 +135,27 @@
- test(obj == base)
- print "ok"
-
-+ print "testing ice_ids...",
-+ sys.stdout.flush()
-+ try:
-+ obj = communicator.stringToProxy("category/locate:default -p 12010 -t 10000")
-+ obj.ice_ids()
-+ test(False)
-+ except Ice.UnknownUserException, ex:
-+ test(ex.unknown == "Test::TestIntfUserException")
-+ except:
-+ test(False)
-+
-+ try:
-+ obj = communicator.stringToProxy("category/finished:default -p 12010 -t 10000")
-+ obj.ice_ids()
-+ test(False)
-+ except Ice.UnknownUserException, ex:
-+ test(ex.unknown == "Test::TestIntfUserException")
-+ except:
-+ test(False)
-+ print "ok"
-+
- print "testing servant locator...",
- sys.stdout.flush()
- base = communicator.stringToProxy("category/locate:default -p 12010 -t 10000")
-diff -ru ../IcePy-3.2.1.orig/test/Ice/servantLocator/TestAMD.ice ./test/Ice/servantLocator/TestAMD.ice
---- ../IcePy-3.2.1.orig/test/Ice/servantLocator/TestAMD.ice 2007-08-08 12:00:54.000000000 -0700
-+++ ./test/Ice/servantLocator/TestAMD.ice 2007-12-21 16:59:17.000000000 -0800
-@@ -17,6 +17,10 @@
- {
- };
-
-+exception TestImpossibleException
-+{
-+};
-+
- ["amd"] interface TestIntf
- {
- void requestFailedException();
-@@ -27,6 +31,11 @@
- void userException();
- void pythonException();
-
-+ void unknownExceptionWithServantException();
-+
-+ string impossibleException(bool throw) throws TestImpossibleException;
-+ string intfUserException(bool throw) throws TestIntfUserException, TestImpossibleException;
-+
- void shutdown();
- };
-
-diff -ru ../IcePy-3.2.1.orig/test/Ice/servantLocator/TestAMDI.py ./test/Ice/servantLocator/TestAMDI.py
---- ../IcePy-3.2.1.orig/test/Ice/servantLocator/TestAMDI.py 2007-08-08 12:00:54.000000000 -0700
-+++ ./test/Ice/servantLocator/TestAMDI.py 2007-12-21 16:59:17.000000000 -0800
-@@ -38,6 +38,29 @@
- def pythonException_async(self, cb, current=None):
- cb.ice_response()
-
-+ def unknownExceptionWithServantException_async(self, cb, current=None):
-+ cb.ice_exception(Ice.ObjectNotExistException())
-+
-+ def impossibleException_async(self, cb, throw, current=None):
-+ if throw:
-+ cb.ice_exception(Test.TestImpossibleException())
-+ else:
-+ #
-+ # Return a value so we can be sure that the stream position
-+ # is reset correctly if finished() throws.
-+ #
-+ cb.ice_response("Hello")
-+
-+ def intfUserException_async(self, cb, throw, current=None):
-+ if throw:
-+ cb.ice_exception(Test.TestIntfUserException())
-+ else:
-+ #
-+ # Return a value so we can be sure that the stream position
-+ # is reset correctly if finished() throws.
-+ #
-+ cb.ice_response("Hello")
-+
- def shutdown_async(self, cb, current=None):
- current.adapter.deactivate()
- cb.ice_response()
-@@ -86,25 +109,25 @@
- self._deactivated = True
-
- def exception(self, current):
-- if current.operation == "requestFailedException":
-+ if current.operation == "ice_ids":
-+ raise Test.TestIntfUserException()
-+ elif current.operation == "requestFailedException":
- raise Ice.ObjectNotExistException()
- elif current.operation == "unknownUserException":
-- ex = Ice.UnknownUserException()
-- ex.unknown = "reason"
-- raise ex
-+ raise Ice.UnknownUserException("reason")
- elif current.operation == "unknownLocalException":
-- ex = Ice.UnknownLocalException()
-- ex.unknown = "reason"
-- raise ex
-+ raise Ice.UnknownLocalException("reason")
- elif current.operation == "unknownException":
-- ex = Ice.UnknownException()
-- ex.unknown = "reason"
-- raise ex
-+ raise Ice.UnknownException("reason")
- elif current.operation == "userException":
- raise Test.TestIntfUserException()
- elif current.operation == "localException":
-- ex = Ice.SocketException()
-- ex.error = 0
-- raise ex
-+ raise Ice.SocketException(0)
- elif current.operation == "pythonException":
- raise RuntimeError("message")
-+ elif current.operation == "unknownExceptionWithServantException":
-+ raise Ice.UnknownException("reason")
-+ elif current.operation == "impossibleException":
-+ raise Test.TestIntfUserException() # Yes, it really is meant to be TestIntfUserException.
-+ elif current.operation == "intfUserException":
-+ raise Test.TestImpossibleException() # Yes, it really is meant to be TestImpossibleException.
-diff -ru ../IcePy-3.2.1.orig/test/Ice/servantLocator/Test.ice ./test/Ice/servantLocator/Test.ice
---- ../IcePy-3.2.1.orig/test/Ice/servantLocator/Test.ice 2007-08-08 12:00:54.000000000 -0700
-+++ ./test/Ice/servantLocator/Test.ice 2007-12-21 16:59:17.000000000 -0800
-@@ -17,6 +17,10 @@
- {
- };
-
-+exception TestImpossibleException
-+{
-+};
-+
- interface TestIntf
- {
- void requestFailedException();
-@@ -27,6 +31,11 @@
- void userException();
- void pythonException();
-
-+ void unknownExceptionWithServantException();
-+
-+ string impossibleException(bool throw) throws TestImpossibleException;
-+ string intfUserException(bool throw) throws TestIntfUserException, TestImpossibleException;
-+
- void shutdown();
- };
-
-diff -ru ../IcePy-3.2.1.orig/test/Ice/servantLocator/TestI.py ./test/Ice/servantLocator/TestI.py
---- ../IcePy-3.2.1.orig/test/Ice/servantLocator/TestI.py 2007-08-08 12:00:54.000000000 -0700
-+++ ./test/Ice/servantLocator/TestI.py 2007-12-21 16:59:17.000000000 -0800
-@@ -38,6 +38,27 @@
- def pythonException(self, current=None):
- pass
-
-+ def unknownExceptionWithServantException(self, current=None):
-+ raise Ice.ObjectNotExistException()
-+
-+ def impossibleException(self, throw, current=None):
-+ if throw:
-+ raise Test.TestImpossibleException()
-+ #
-+ # Return a value so we can be sure that the stream position
-+ # is reset correctly if finished() throws.
-+ #
-+ return "Hello"
-+
-+ def intfUserException(self, throw, current=None):
-+ if throw:
-+ raise Test.TestIntfUserException()
-+ #
-+ # Return a value so we can be sure that the stream position
-+ # is reset correctly if finished() throws.
-+ #
-+ return "Hello"
-+
- def shutdown(self, current=None):
- current.adapter.deactivate()
-
-@@ -85,25 +106,25 @@
- self._deactivated = True
-
- def exception(self, current):
-- if current.operation == "requestFailedException":
-+ if current.operation == "ice_ids":
-+ raise Test.TestIntfUserException()
-+ elif current.operation == "requestFailedException":
- raise Ice.ObjectNotExistException()
- elif current.operation == "unknownUserException":
-- ex = Ice.UnknownUserException()
-- ex.unknown = "reason"
-- raise ex
-+ raise Ice.UnknownUserException("reason")
- elif current.operation == "unknownLocalException":
-- ex = Ice.UnknownLocalException()
-- ex.unknown = "reason"
-- raise ex
-+ raise Ice.UnknownLocalException("reason")
- elif current.operation == "unknownException":
-- ex = Ice.UnknownException()
-- ex.unknown = "reason"
-- raise ex
-+ raise Ice.UnknownException("reason")
- elif current.operation == "userException":
- raise Test.TestIntfUserException()
- elif current.operation == "localException":
-- ex = Ice.SocketException()
-- ex.error = 0
-- raise ex
-+ raise Ice.SocketException(0)
- elif current.operation == "pythonException":
- raise RuntimeError("message")
-+ elif current.operation == "unknownExceptionWithServantException":
-+ raise Ice.UnknownException("reason")
-+ elif current.operation == "impossibleException":
-+ raise Test.TestIntfUserException() # Yes, it really is meant to be TestIntfUserException.
-+ elif current.operation == "intfUserException":
-+ raise Test.TestImpossibleException() # Yes, it really is meant to be TestImpossibleException.
Copied: trunk/dports/devel/ice-python/files/patch-ServantLocator.locate-can-throw-user-exceptions.diff (from rev 34039, trunk/dports/devel/ice-python/files/patch-ServantLocator.locate-can-throw-user-exceptions)
===================================================================
--- trunk/dports/devel/ice-python/files/patch-ServantLocator.locate-can-throw-user-exceptions.diff (rev 0)
+++ trunk/dports/devel/ice-python/files/patch-ServantLocator.locate-can-throw-user-exceptions.diff 2008-02-11 03:56:11 UTC (rev 34045)
@@ -0,0 +1,969 @@
+diff -ru ../IcePy-3.2.1.orig/modules/IcePy/Communicator.cpp ./modules/IcePy/Communicator.cpp
+--- ../IcePy-3.2.1.orig/modules/IcePy/Communicator.cpp 2007-08-08 12:00:54.000000000 -0700
++++ ./modules/IcePy/Communicator.cpp 2007-12-21 16:59:17.000000000 -0800
+@@ -161,11 +161,18 @@
+ {
+ data.threadHook = new ThreadNotificationWrapper(threadHook.get());
+ }
++ }
+
++ try
++ {
++ data.properties = Ice::createProperties(seq, data.properties);
++ }
++ catch(const Ice::Exception& ex)
++ {
++ setPythonException(ex);
++ return -1;
+ }
+
+- data.properties = Ice::createProperties(seq, data.properties);
+-
+ //
+ // Disable collocation optimization, otherwise a Python invocation on
+ // a collocated servant results in a CollocationOptimizationException
+@@ -200,7 +207,7 @@
+ }
+ catch(const Ice::Exception& ex)
+ {
+- for(i = 0; i < argc + 1; ++i)
++ for(i = 0; i < argc; ++i)
+ {
+ free(argv[i]);
+ }
+@@ -224,7 +231,7 @@
+ }
+ }
+
+- for(i = 0; i < argc + 1; ++i)
++ for(i = 0; i < argc; ++i)
+ {
+ free(argv[i]);
+ }
+diff -ru ../IcePy-3.2.1.orig/modules/IcePy/.depend ./modules/IcePy/.depend
+--- ../IcePy-3.2.1.orig/modules/IcePy/.depend 2007-08-08 12:00:54.000000000 -0700
++++ ./modules/IcePy/.depend 2007-12-21 16:59:17.000000000 -0800
+@@ -1,15 +1,15 @@
+-Communicator$(OBJEXT): Communicator.cpp Communicator.h Config.h ImplicitContext.h Logger.h Util.h ObjectAdapter.h ObjectFactory.h Properties.h Proxy.h ThreadNotification.h
+-Connection$(OBJEXT): Connection.cpp Connection.h Config.h ObjectAdapter.h Proxy.h Util.h
+-Current$(OBJEXT): Current.cpp Current.h Config.h Connection.h ObjectAdapter.h Util.h
+-ImplicitContext$(OBJEXT): ImplicitContext.cpp ImplicitContext.h Config.h ObjectAdapter.h Proxy.h Util.h
+-Init$(OBJEXT): Init.cpp Communicator.h Config.h Connection.h Current.h ImplicitContext.h Logger.h Util.h ObjectAdapter.h Operation.h Properties.h Proxy.h Slice.h Types.h
+-Logger$(OBJEXT): Logger.cpp Logger.h Config.h Util.h
+-ObjectAdapter$(OBJEXT): ObjectAdapter.cpp ObjectAdapter.h Config.h Communicator.h Current.h Operation.h Proxy.h Util.h
+-ObjectFactory$(OBJEXT): ObjectFactory.cpp ObjectFactory.h Config.h Types.h Util.h
+-Operation$(OBJEXT): Operation.cpp Operation.h Config.h Current.h Proxy.h Types.h Util.h
+-Properties$(OBJEXT): Properties.cpp Properties.h Config.h Util.h
+-Proxy$(OBJEXT): Proxy.cpp Proxy.h Config.h Communicator.h Connection.h Util.h
+-Slice$(OBJEXT): Slice.cpp Slice.h Config.h Util.h
+-ThreadNotification$(OBJEXT): ThreadNotification.cpp ThreadNotification.h Config.h Util.h
+-Types$(OBJEXT): Types.cpp Types.h Config.h Util.h Current.h Proxy.h
+-Util$(OBJEXT): Util.cpp Util.h Config.h
++Communicator$(OBJEXT): Communicator.cpp ./Communicator.h ./Config.h ./ImplicitContext.h ./Logger.h ./Util.h ./ObjectAdapter.h ./ObjectFactory.h ./Properties.h ./Proxy.h ./ThreadNotification.h
++Connection$(OBJEXT): Connection.cpp ./Connection.h ./Config.h ./ObjectAdapter.h ./Proxy.h ./Util.h
++Current$(OBJEXT): Current.cpp ./Current.h ./Config.h ./Connection.h ./ObjectAdapter.h ./Util.h
++ImplicitContext$(OBJEXT): ImplicitContext.cpp ./ImplicitContext.h ./Config.h ./ObjectAdapter.h ./Proxy.h ./Util.h
++Init$(OBJEXT): Init.cpp ./Communicator.h ./Config.h ./Connection.h ./Current.h ./ImplicitContext.h ./Logger.h ./Util.h ./ObjectAdapter.h ./Operation.h ./Properties.h ./Proxy.h ./Slice.h ./Types.h
++Logger$(OBJEXT): Logger.cpp ./Logger.h ./Config.h ./Util.h
++ObjectAdapter$(OBJEXT): ObjectAdapter.cpp ./ObjectAdapter.h ./Config.h ./Communicator.h ./Current.h ./Operation.h ./Proxy.h ./Types.h ./Util.h
++ObjectFactory$(OBJEXT): ObjectFactory.cpp ./ObjectFactory.h ./Config.h ./Types.h ./Util.h
++Operation$(OBJEXT): Operation.cpp ./Operation.h ./Config.h ./Current.h ./Proxy.h ./Types.h ./Util.h
++Properties$(OBJEXT): Properties.cpp ./Properties.h ./Config.h ./Util.h
++Proxy$(OBJEXT): Proxy.cpp ./Proxy.h ./Config.h ./Communicator.h ./Connection.h ./Operation.h ./Util.h
++Slice$(OBJEXT): Slice.cpp ./Slice.h ./Config.h ./Util.h
++ThreadNotification$(OBJEXT): ThreadNotification.cpp ./ThreadNotification.h ./Config.h ./Util.h
++Types$(OBJEXT): Types.cpp ./Types.h ./Config.h ./Util.h ./Current.h ./Proxy.h
++Util$(OBJEXT): Util.cpp ./Util.h ./Config.h
+diff -ru ../IcePy-3.2.1.orig/modules/IcePy/ObjectAdapter.cpp ./modules/IcePy/ObjectAdapter.cpp
+--- ../IcePy-3.2.1.orig/modules/IcePy/ObjectAdapter.cpp 2007-08-08 12:00:54.000000000 -0700
++++ ./modules/IcePy/ObjectAdapter.cpp 2007-12-21 16:59:17.000000000 -0800
+@@ -15,6 +15,7 @@
+ #include <Current.h>
+ #include <Operation.h>
+ #include <Proxy.h>
++#include <Types.h>
+ #include <Util.h>
+ #include <Ice/Communicator.h>
+ #include <Ice/LocalException.h>
+@@ -226,7 +227,21 @@
+ PyObjectHandle res = PyObject_CallMethod(_locator, STRCAST("locate"), STRCAST("O"), c->current);
+ if(PyErr_Occurred())
+ {
+- throwPythonException();
++ PyException ex;
++
++ PyObject* userExceptionType = lookupType("Ice.UserException");
++ if(PyObject_IsInstance(ex.ex.get(), userExceptionType))
++ {
++ PyObjectHandle iceType = PyObject_GetAttrString(ex.ex.get(), STRCAST("ice_type"));
++ assert(iceType.get());
++ ExceptionInfoPtr info = ExceptionInfoPtr::dynamicCast(getException(iceType.get()));
++ assert(info);
++ info->raise(ex.ex.get(), current.adapter->getCommunicator());
++ }
++ else
++ {
++ ex.raise();
++ }
+ }
+
+ if(res.get() == Py_None)
+@@ -274,7 +289,8 @@
+ }
+
+ void
+-IcePy::ServantLocatorWrapper::finished(const Ice::Current&, const Ice::ObjectPtr&, const Ice::LocalObjectPtr& cookie)
++IcePy::ServantLocatorWrapper::finished(const Ice::Current& current, const Ice::ObjectPtr&,
++ const Ice::LocalObjectPtr& cookie)
+ {
+ CookiePtr c = CookiePtr::dynamicCast(cookie);
+ assert(c);
+@@ -286,7 +302,21 @@
+ servantObj.get(), c->cookie);
+ if(PyErr_Occurred())
+ {
+- throwPythonException();
++ PyException ex;
++
++ PyObject* userExceptionType = lookupType("Ice.UserException");
++ if(PyObject_IsInstance(ex.ex.get(), userExceptionType))
++ {
++ PyObjectHandle iceType = PyObject_GetAttrString(ex.ex.get(), STRCAST("ice_type"));
++ assert(iceType.get());
++ ExceptionInfoPtr info = ExceptionInfoPtr::dynamicCast(getException(iceType.get()));
++ assert(info);
++ info->raise(ex.ex.get(), current.adapter->getCommunicator());
++ }
++ else
++ {
++ ex.raise();
++ }
+ }
+ }
+
+diff -ru ../IcePy-3.2.1.orig/modules/IcePy/Operation.cpp ./modules/IcePy/Operation.cpp
+--- ../IcePy-3.2.1.orig/modules/IcePy/Operation.cpp 2007-08-08 12:00:54.000000000 -0700
++++ ./modules/IcePy/Operation.cpp 2007-12-21 16:59:17.000000000 -0800
+@@ -50,6 +50,7 @@
+
+ OperationI(const char*, PyObject*, PyObject*, int, PyObject*, PyObject*, PyObject*, PyObject*, PyObject*);
+
++ virtual PyObject* invoke(const Ice::ObjectPrx&, PyObject*);
+ virtual PyObject* invoke(const Ice::ObjectPrx&, PyObject*, PyObject*);
+ virtual PyObject* invokeAsync(const Ice::ObjectPrx&, PyObject*, PyObject*, PyObject*);
+ virtual void deprecate(const string&);
+@@ -476,6 +477,37 @@
+ }
+
+ PyObject*
++IcePy::OperationI::invoke(const Ice::ObjectPrx& proxy, PyObject* args)
++{
++ //
++ // This method is used when the optional context argument may be included in the args tuple.
++ //
++
++ assert(PyTuple_Check(args));
++
++ PyObject* ctx = Py_None;
++
++ PyObjectHandle slice;
++ if(PyTuple_GET_SIZE(args) > static_cast<Py_ssize_t>(_inParams.size()))
++ {
++ ctx = PyTuple_GET_ITEM(args, PyTuple_GET_SIZE(args) - 1);
++ if(ctx != Py_None && !PyDict_Check(ctx))
++ {
++ PyErr_Format(PyExc_ValueError, STRCAST("context argument must be None or a dictionary"));
++ return 0;
++ }
++ slice = PyTuple_GetSlice(args, 0, PyTuple_GET_SIZE(args) - 1);
++ }
++ else
++ {
++ slice = args;
++ Py_INCREF(args);
++ }
++
++ return invoke(proxy, slice.get(), ctx);
++}
++
++PyObject*
+ IcePy::OperationI::invoke(const Ice::ObjectPrx& proxy, PyObject* args, PyObject* pyctx)
+ {
+ Ice::CommunicatorPtr communicator = proxy->ice_getCommunicator();
+@@ -991,6 +1023,9 @@
+ else
+ {
+ Ice::OutputStreamPtr os = Ice::createOutputStream(communicator);
++
++ os->writeBool(info->usesClasses);
++
+ ObjectMap objectMap;
+ info->marshal(ex.ex.get(), os, &objectMap);
+
+diff -ru ../IcePy-3.2.1.orig/modules/IcePy/Operation.h ./modules/IcePy/Operation.h
+--- ../IcePy-3.2.1.orig/modules/IcePy/Operation.h 2007-08-08 12:00:54.000000000 -0700
++++ ./modules/IcePy/Operation.h 2007-12-21 16:59:17.000000000 -0800
+@@ -24,6 +24,7 @@
+
+ virtual ~Operation();
+
++ virtual PyObject* invoke(const Ice::ObjectPrx&, PyObject*) = 0;
+ virtual PyObject* invoke(const Ice::ObjectPrx&, PyObject*, PyObject*) = 0;
+ virtual PyObject* invokeAsync(const Ice::ObjectPrx&, PyObject*, PyObject*, PyObject*) = 0;
+ virtual void deprecate(const std::string&) = 0;
+diff -ru ../IcePy-3.2.1.orig/modules/IcePy/Proxy.cpp ./modules/IcePy/Proxy.cpp
+--- ../IcePy-3.2.1.orig/modules/IcePy/Proxy.cpp 2007-08-08 12:00:54.000000000 -0700
++++ ./modules/IcePy/Proxy.cpp 2007-12-21 16:59:17.000000000 -0800
+@@ -15,6 +15,7 @@
+ #include <structmember.h>
+ #include <Communicator.h>
+ #include <Connection.h>
++#include <Operation.h>
+ #include <Util.h>
+ #include <Ice/Communicator.h>
+ #include <Ice/LocalException.h>
+@@ -220,47 +221,17 @@
+ static PyObject*
+ proxyIceIsA(ProxyObject* self, PyObject* args)
+ {
+- char* type;
+- PyObject* ctx = 0;
+- if(!PyArg_ParseTuple(args, STRCAST("s|O!"), &type, &PyDict_Type, &ctx))
+- {
+- return 0;
+- }
+-
+ assert(self->proxy);
+
+- bool b;
+- try
+- {
+- AllowThreads allowThreads; // Release Python's global interpreter lock during remote invocations.
+- if(ctx)
+- {
+- Ice::Context context;
+- if(!dictionaryToContext(ctx, context))
+- {
+- return 0;
+- }
+- b = (*self->proxy)->ice_isA(type, context);
+- }
+- else
+- {
+- b = (*self->proxy)->ice_isA(type);
+- }
+- }
+- catch(const Ice::Exception& ex)
+- {
+- setPythonException(ex);
+- return 0;
+- }
++ PyObject* objectType = lookupType("Ice.Object");
++ assert(objectType);
++ PyObjectHandle obj = PyObject_GetAttrString(objectType, "_op_ice_isA");
++ assert(obj.get());
+
+- if(b)
+- {
+- PyRETURN_TRUE;
+- }
+- else
+- {
+- PyRETURN_FALSE;
+- }
++ OperationPtr op = getOperation(obj.get());
++ assert(op);
++
++ return op->invoke(*self->proxy, args);
+ }
+
+ #ifdef WIN32
+@@ -269,39 +240,17 @@
+ static PyObject*
+ proxyIcePing(ProxyObject* self, PyObject* args)
+ {
+- PyObject* ctx = 0;
+- if(!PyArg_ParseTuple(args, STRCAST("|O!"), &PyDict_Type, &ctx))
+- {
+- return 0;
+- }
+-
+ assert(self->proxy);
+
+- try
+- {
+- AllowThreads allowThreads; // Release Python's global interpreter lock during remote invocations.
+- if(ctx)
+- {
+- Ice::Context context;
+- if(!dictionaryToContext(ctx, context))
+- {
+- return 0;
+- }
+- (*self->proxy)->ice_ping(context);
+- }
+- else
+- {
+- (*self->proxy)->ice_ping();
+- }
+- }
+- catch(const Ice::Exception& ex)
+- {
+- setPythonException(ex);
+- return 0;
+- }
++ PyObject* objectType = lookupType("Ice.Object");
++ assert(objectType);
++ PyObjectHandle obj = PyObject_GetAttrString(objectType, "_op_ice_ping");
++ assert(obj.get());
+
+- Py_INCREF(Py_None);
+- return Py_None;
++ OperationPtr op = getOperation(obj.get());
++ assert(op);
++
++ return op->invoke(*self->proxy, args);
+ }
+
+ #ifdef WIN32
+@@ -310,45 +259,17 @@
+ static PyObject*
+ proxyIceIds(ProxyObject* self, PyObject* args)
+ {
+- PyObject* ctx = 0;
+- if(!PyArg_ParseTuple(args, STRCAST("|O!"), &PyDict_Type, &ctx))
+- {
+- return 0;
+- }
+-
+ assert(self->proxy);
+
+- Ice::StringSeq ids;
+- try
+- {
+- AllowThreads allowThreads; // Release Python's global interpreter lock during remote invocations.
+- if(ctx)
+- {
+- Ice::Context context;
+- if(!dictionaryToContext(ctx, context))
+- {
+- return 0;
+- }
+- ids = (*self->proxy)->ice_ids(context);
+- }
+- else
+- {
+- ids = (*self->proxy)->ice_ids();
+- }
+- }
+- catch(const Ice::Exception& ex)
+- {
+- setPythonException(ex);
+- return 0;
+- }
++ PyObject* objectType = lookupType("Ice.Object");
++ assert(objectType);
++ PyObjectHandle obj = PyObject_GetAttrString(objectType, "_op_ice_ids");
++ assert(obj.get());
+
+- PyObject* list = PyList_New(0);
+- if(!list || !stringSeqToList(ids, list))
+- {
+- return 0;
+- }
++ OperationPtr op = getOperation(obj.get());
++ assert(op);
+
+- return list;
++ return op->invoke(*self->proxy, args);
+ }
+
+ #ifdef WIN32
+@@ -357,39 +278,17 @@
+ static PyObject*
+ proxyIceId(ProxyObject* self, PyObject* args)
+ {
+- PyObject* ctx = 0;
+- if(!PyArg_ParseTuple(args, STRCAST("|O!"), &PyDict_Type, &ctx))
+- {
+- return 0;
+- }
+-
+ assert(self->proxy);
+
+- string id;
+- try
+- {
+- AllowThreads allowThreads; // Release Python's global interpreter lock during remote invocations.
+- if(ctx)
+- {
+- Ice::Context context;
+- if(!dictionaryToContext(ctx, context))
+- {
+- return 0;
+- }
+- id = (*self->proxy)->ice_id(context);
+- }
+- else
+- {
+- id = (*self->proxy)->ice_id();
+- }
+- }
+- catch(const Ice::Exception& ex)
+- {
+- setPythonException(ex);
+- return 0;
+- }
++ PyObject* objectType = lookupType("Ice.Object");
++ assert(objectType);
++ PyObjectHandle obj = PyObject_GetAttrString(objectType, "_op_ice_id");
++ assert(obj.get());
++
++ OperationPtr op = getOperation(obj.get());
++ assert(op);
+
+- return Py_BuildValue(STRCAST("s"), id.c_str());
++ return op->invoke(*self->proxy, args);
+ }
+
+ #ifdef WIN32
+diff -ru ../IcePy-3.2.1.orig/modules/IcePy/Types.cpp ./modules/IcePy/Types.cpp
+--- ../IcePy-3.2.1.orig/modules/IcePy/Types.cpp 2007-08-08 12:00:54.000000000 -0700
++++ ./modules/IcePy/Types.cpp 2007-12-21 16:59:30.000000000 -0800
+@@ -16,6 +16,8 @@
+ #include <Util.h>
+ #include <IceUtil/InputUtil.h>
+ #include <IceUtil/ScopedArray.h>
++#include <Ice/BasicStream.h>
++#include <Ice/Initialize.h>
+ #include <Ice/LocalException.h>
+
+ using namespace std;
+@@ -2284,6 +2286,116 @@
+ }
+ }
+
++namespace
++{
++
++//
++// Subclass of UserException that wraps a Python user exception.
++//
++class UserExceptionWrapper : public Ice::UserException
++{
++public:
++
++ UserExceptionWrapper(PyObject*, const ExceptionInfoPtr&, const Ice::CommunicatorPtr&);
++ virtual ~UserExceptionWrapper() throw();
++
++ virtual string ice_name() const;
++ virtual Ice::Exception* ice_clone() const;
++ virtual void ice_throw() const;
++
++ virtual void __write(IceInternal::BasicStream*) const;
++ virtual void __read(IceInternal::BasicStream*, bool);
++
++ virtual bool __usesClasses() const;
++
++private:
++
++ PyObjectHandle _ex;
++ ExceptionInfoPtr _info;
++ Ice::CommunicatorPtr _communicator;
++};
++
++UserExceptionWrapper::UserExceptionWrapper(PyObject* ex, const ExceptionInfoPtr& info,
++ const Ice::CommunicatorPtr& communicator) :
++ _ex(ex), _info(info), _communicator(communicator)
++{
++ Py_INCREF(ex);
++}
++
++UserExceptionWrapper::~UserExceptionWrapper() throw()
++{
++ AdoptThread adoptThread; // Ensure the current thread is able to call into Python.
++
++ _ex = 0;
++}
++
++string
++UserExceptionWrapper::ice_name() const
++{
++ return _info->id;
++}
++
++Ice::Exception*
++UserExceptionWrapper::ice_clone() const
++{
++ return new UserExceptionWrapper(*this);
++}
++
++void
++UserExceptionWrapper::ice_throw() const
++{
++ throw *this;
++}
++
++void
++UserExceptionWrapper::__write(IceInternal::BasicStream* os) const
++{
++ AdoptThread adoptThread; // Ensure the current thread is able to call into Python.
++
++ //
++ // To marshal a Python user exception into a BasicStream, we first
++ // marshal it into an OutputStream and then write the marshaled
++ // bytes as a blob into the BasicStream.
++ //
++ Ice::OutputStreamPtr stream = Ice::createOutputStream(_communicator);
++
++ //
++ // The C++ run time is in charge of marshaling this exception; as such, it has
++ // already written the "usesClasses" boolean to the stream so we must not
++ // write it again.
++ //
++ ObjectMap objectMap;
++ _info->marshal(const_cast<PyObject*>(_ex.get()), stream, &objectMap);
++
++ //
++ // It is safe to flush any pending objects here. The C++ run time will also
++ // flush the pending objects on the BasicStream, but there will never be
++ // any objects pending on that stream.
++ //
++ if(_info->usesClasses)
++ {
++ stream->writePendingObjects();
++ }
++
++ Ice::ByteSeq bytes;
++ stream->finished(bytes);
++ os->writeBlob(bytes);
++}
++
++void
++UserExceptionWrapper::__read(IceInternal::BasicStream*, bool)
++{
++ assert(false);
++}
++
++bool
++UserExceptionWrapper::__usesClasses() const
++{
++ return _info->usesClasses;
++}
++
++}
++
+ //
+ // ExceptionInfo implementation.
+ //
+@@ -2296,8 +2408,6 @@
+ throw AbortMarshaling();
+ }
+
+- os->writeBool(usesClasses);
+-
+ ExceptionInfoPtr info = this;
+ while(info)
+ {
+@@ -2405,6 +2515,12 @@
+ }
+ }
+
++void
++IcePy::ExceptionInfo::raise(PyObject* ex, const Ice::CommunicatorPtr& communicator)
++{
++ throw UserExceptionWrapper(ex, this, communicator);
++}
++
+ //
+ // lookupClassInfo()
+ //
+diff -ru ../IcePy-3.2.1.orig/modules/IcePy/Types.h ./modules/IcePy/Types.h
+--- ../IcePy-3.2.1.orig/modules/IcePy/Types.h 2007-08-08 12:00:54.000000000 -0700
++++ ./modules/IcePy/Types.h 2007-12-21 16:59:17.000000000 -0800
+@@ -356,6 +356,8 @@
+ void print(PyObject*, IceUtil::Output&);
+ void printMembers(PyObject*, IceUtil::Output&, PrintObjectHistory*);
+
++ void raise(PyObject*, const Ice::CommunicatorPtr&);
++
+ std::string id;
+ ExceptionInfoPtr base;
+ DataMemberList members;
+diff -ru ../IcePy-3.2.1.orig/modules/IcePy/Util.cpp ./modules/IcePy/Util.cpp
+--- ../IcePy-3.2.1.orig/modules/IcePy/Util.cpp 2007-08-08 12:00:54.000000000 -0700
++++ ./modules/IcePy/Util.cpp 2007-12-21 16:59:17.000000000 -0800
+@@ -58,7 +58,7 @@
+ }
+
+ PyObject*
+-IcePy::PyObjectHandle::get()
++IcePy::PyObjectHandle::get() const
+ {
+ return _p;
+ }
+diff -ru ../IcePy-3.2.1.orig/modules/IcePy/Util.h ./modules/IcePy/Util.h
+--- ../IcePy-3.2.1.orig/modules/IcePy/Util.h 2007-08-08 12:00:54.000000000 -0700
++++ ./modules/IcePy/Util.h 2007-12-21 16:59:17.000000000 -0800
+@@ -61,7 +61,7 @@
+ void operator=(PyObject*);
+ void operator=(const PyObjectHandle&);
+
+- PyObject* get();
++ PyObject* get() const;
+ PyObject* release();
+
+ private:
+diff -ru ../IcePy-3.2.1.orig/test/Ice/servantLocator/AllTests.py ./test/Ice/servantLocator/AllTests.py
+--- ../IcePy-3.2.1.orig/test/Ice/servantLocator/AllTests.py 2007-08-08 12:00:54.000000000 -0700
++++ ./test/Ice/servantLocator/AllTests.py 2007-12-21 16:59:17.000000000 -0800
+@@ -18,63 +18,108 @@
+
+ try:
+ obj.requestFailedException()
+- test(false)
++ test(False)
+ except Ice.ObjectNotExistException, ex:
+ if not collocated:
+ test(ex.id == obj.ice_getIdentity())
+ test(ex.facet == obj.ice_getFacet())
+ test(ex.operation == "requestFailedException")
++ except:
++ test(False)
+
+ try:
+ obj.unknownUserException()
+- test(false)
++ test(False)
+ except Ice.UnknownUserException, ex:
+ test(ex.unknown == "reason")
+- pass
++ except:
++ test(False)
+
+ try:
+ obj.unknownLocalException()
+- test(false)
++ test(False)
+ except Ice.UnknownLocalException, ex:
+ test(ex.unknown == "reason")
+- pass
++ except:
++ test(False)
+
+ try:
+ obj.unknownException()
+- test(false)
++ test(False)
+ except Ice.UnknownException, ex:
+ test(ex.unknown == "reason")
+ pass
+
+ try:
+ obj.userException()
+- test(false)
++ test(False)
+ except Ice.UnknownUserException, ex:
+- #print ex.unknown
+- test(not collocated)
+- test(ex.unknown.find("Test.TestIntfUserException") >= 0)
+- except Test.TestIntfUserException:
+- test(collocated)
++ test(ex.unknown.find("Test::TestIntfUserException") >= 0)
++ except:
++ test(False)
+
+ try:
+ obj.localException()
+- test(false)
++ test(False)
+ except Ice.UnknownLocalException, ex:
+- #print ex.unknown
+ test(not collocated)
+ test(ex.unknown.find("Ice.SocketException") >= 0)
+ except SocketException:
+ test(collocated)
++ except:
++ test(False)
+
+ try:
+ obj.pythonException()
+- test(false)
++ test(False)
+ except Ice.UnknownException, ex:
+- #print ex.unknown
+- test(not collocated)
+ test(ex.unknown.find("RuntimeError: message") >= 0)
+- except RuntimeError:
+- test(collocated)
++ except:
++ test(False)
++
++ try:
++ obj.unknownExceptionWithServantException()
++ test(False)
++ except Ice.UnknownException, ex:
++ test(ex.unknown == "reason")
++ except:
++ test(False)
++
++ try:
++ obj.impossibleException(False)
++ test(False)
++ except Ice.UnknownUserException:
++ # Operation doesn't throw, but locate() and finshed() throw TestIntfUserException.
++ pass
++ except:
++ test(False)
++
++ try:
++ obj.impossibleException(True)
++ test(False)
++ except Ice.UnknownUserException:
++ # Operation doesn't throw, but locate() and finshed() throw TestIntfUserException.
++ pass
++ except:
++ test(False)
++
++ try:
++ obj.intfUserException(False)
++ test(False)
++ except Test.TestImpossibleException:
++ # Operation doesn't throw, but locate() and finished() throw TestImpossibleException.
++ pass
++ except:
++ test(False)
++
++ try:
++ obj.intfUserException(True)
++ test(False)
++ except Test.TestImpossibleException:
++ # Operation throws TestIntfUserException, but locate() and finished() throw TestImpossibleException.
++ pass
++ except:
++ test(False)
+
+ def allTests(communicator, collocated):
+ print "testing stringToProxy... ",
+@@ -90,6 +135,27 @@
+ test(obj == base)
+ print "ok"
+
++ print "testing ice_ids...",
++ sys.stdout.flush()
++ try:
++ obj = communicator.stringToProxy("category/locate:default -p 12010 -t 10000")
++ obj.ice_ids()
++ test(False)
++ except Ice.UnknownUserException, ex:
++ test(ex.unknown == "Test::TestIntfUserException")
++ except:
++ test(False)
++
++ try:
++ obj = communicator.stringToProxy("category/finished:default -p 12010 -t 10000")
++ obj.ice_ids()
++ test(False)
++ except Ice.UnknownUserException, ex:
++ test(ex.unknown == "Test::TestIntfUserException")
++ except:
++ test(False)
++ print "ok"
++
+ print "testing servant locator...",
+ sys.stdout.flush()
+ base = communicator.stringToProxy("category/locate:default -p 12010 -t 10000")
+diff -ru ../IcePy-3.2.1.orig/test/Ice/servantLocator/TestAMD.ice ./test/Ice/servantLocator/TestAMD.ice
+--- ../IcePy-3.2.1.orig/test/Ice/servantLocator/TestAMD.ice 2007-08-08 12:00:54.000000000 -0700
++++ ./test/Ice/servantLocator/TestAMD.ice 2007-12-21 16:59:17.000000000 -0800
+@@ -17,6 +17,10 @@
+ {
+ };
+
++exception TestImpossibleException
++{
++};
++
+ ["amd"] interface TestIntf
+ {
+ void requestFailedException();
+@@ -27,6 +31,11 @@
+ void userException();
+ void pythonException();
+
++ void unknownExceptionWithServantException();
++
++ string impossibleException(bool throw) throws TestImpossibleException;
++ string intfUserException(bool throw) throws TestIntfUserException, TestImpossibleException;
++
+ void shutdown();
+ };
+
+diff -ru ../IcePy-3.2.1.orig/test/Ice/servantLocator/TestAMDI.py ./test/Ice/servantLocator/TestAMDI.py
+--- ../IcePy-3.2.1.orig/test/Ice/servantLocator/TestAMDI.py 2007-08-08 12:00:54.000000000 -0700
++++ ./test/Ice/servantLocator/TestAMDI.py 2007-12-21 16:59:17.000000000 -0800
+@@ -38,6 +38,29 @@
+ def pythonException_async(self, cb, current=None):
+ cb.ice_response()
+
++ def unknownExceptionWithServantException_async(self, cb, current=None):
++ cb.ice_exception(Ice.ObjectNotExistException())
++
++ def impossibleException_async(self, cb, throw, current=None):
++ if throw:
++ cb.ice_exception(Test.TestImpossibleException())
++ else:
++ #
++ # Return a value so we can be sure that the stream position
++ # is reset correctly if finished() throws.
++ #
++ cb.ice_response("Hello")
++
++ def intfUserException_async(self, cb, throw, current=None):
++ if throw:
++ cb.ice_exception(Test.TestIntfUserException())
++ else:
++ #
++ # Return a value so we can be sure that the stream position
++ # is reset correctly if finished() throws.
++ #
++ cb.ice_response("Hello")
++
+ def shutdown_async(self, cb, current=None):
+ current.adapter.deactivate()
+ cb.ice_response()
+@@ -86,25 +109,25 @@
+ self._deactivated = True
+
+ def exception(self, current):
+- if current.operation == "requestFailedException":
++ if current.operation == "ice_ids":
++ raise Test.TestIntfUserException()
++ elif current.operation == "requestFailedException":
+ raise Ice.ObjectNotExistException()
+ elif current.operation == "unknownUserException":
+- ex = Ice.UnknownUserException()
+- ex.unknown = "reason"
+- raise ex
++ raise Ice.UnknownUserException("reason")
+ elif current.operation == "unknownLocalException":
+- ex = Ice.UnknownLocalException()
+- ex.unknown = "reason"
+- raise ex
++ raise Ice.UnknownLocalException("reason")
+ elif current.operation == "unknownException":
+- ex = Ice.UnknownException()
+- ex.unknown = "reason"
+- raise ex
++ raise Ice.UnknownException("reason")
+ elif current.operation == "userException":
+ raise Test.TestIntfUserException()
+ elif current.operation == "localException":
+- ex = Ice.SocketException()
+- ex.error = 0
+- raise ex
++ raise Ice.SocketException(0)
+ elif current.operation == "pythonException":
+ raise RuntimeError("message")
++ elif current.operation == "unknownExceptionWithServantException":
++ raise Ice.UnknownException("reason")
++ elif current.operation == "impossibleException":
++ raise Test.TestIntfUserException() # Yes, it really is meant to be TestIntfUserException.
++ elif current.operation == "intfUserException":
++ raise Test.TestImpossibleException() # Yes, it really is meant to be TestImpossibleException.
+diff -ru ../IcePy-3.2.1.orig/test/Ice/servantLocator/Test.ice ./test/Ice/servantLocator/Test.ice
+--- ../IcePy-3.2.1.orig/test/Ice/servantLocator/Test.ice 2007-08-08 12:00:54.000000000 -0700
++++ ./test/Ice/servantLocator/Test.ice 2007-12-21 16:59:17.000000000 -0800
+@@ -17,6 +17,10 @@
+ {
+ };
+
++exception TestImpossibleException
++{
++};
++
+ interface TestIntf
+ {
+ void requestFailedException();
+@@ -27,6 +31,11 @@
+ void userException();
+ void pythonException();
+
++ void unknownExceptionWithServantException();
++
++ string impossibleException(bool throw) throws TestImpossibleException;
++ string intfUserException(bool throw) throws TestIntfUserException, TestImpossibleException;
++
+ void shutdown();
+ };
+
+diff -ru ../IcePy-3.2.1.orig/test/Ice/servantLocator/TestI.py ./test/Ice/servantLocator/TestI.py
+--- ../IcePy-3.2.1.orig/test/Ice/servantLocator/TestI.py 2007-08-08 12:00:54.000000000 -0700
++++ ./test/Ice/servantLocator/TestI.py 2007-12-21 16:59:17.000000000 -0800
+@@ -38,6 +38,27 @@
+ def pythonException(self, current=None):
+ pass
+
++ def unknownExceptionWithServantException(self, current=None):
++ raise Ice.ObjectNotExistException()
++
++ def impossibleException(self, throw, current=None):
++ if throw:
++ raise Test.TestImpossibleException()
++ #
++ # Return a value so we can be sure that the stream position
++ # is reset correctly if finished() throws.
++ #
++ return "Hello"
++
++ def intfUserException(self, throw, current=None):
++ if throw:
++ raise Test.TestIntfUserException()
++ #
++ # Return a value so we can be sure that the stream position
++ # is reset correctly if finished() throws.
++ #
++ return "Hello"
++
+ def shutdown(self, current=None):
+ current.adapter.deactivate()
+
+@@ -85,25 +106,25 @@
+ self._deactivated = True
+
+ def exception(self, current):
+- if current.operation == "requestFailedException":
++ if current.operation == "ice_ids":
++ raise Test.TestIntfUserException()
++ elif current.operation == "requestFailedException":
+ raise Ice.ObjectNotExistException()
+ elif current.operation == "unknownUserException":
+- ex = Ice.UnknownUserException()
+- ex.unknown = "reason"
+- raise ex
++ raise Ice.UnknownUserException("reason")
+ elif current.operation == "unknownLocalException":
+- ex = Ice.UnknownLocalException()
+- ex.unknown = "reason"
+- raise ex
++ raise Ice.UnknownLocalException("reason")
+ elif current.operation == "unknownException":
+- ex = Ice.UnknownException()
+- ex.unknown = "reason"
+- raise ex
++ raise Ice.UnknownException("reason")
+ elif current.operation == "userException":
+ raise Test.TestIntfUserException()
+ elif current.operation == "localException":
+- ex = Ice.SocketException()
+- ex.error = 0
+- raise ex
++ raise Ice.SocketException(0)
+ elif current.operation == "pythonException":
+ raise RuntimeError("message")
++ elif current.operation == "unknownExceptionWithServantException":
++ raise Ice.UnknownException("reason")
++ elif current.operation == "impossibleException":
++ raise Test.TestIntfUserException() # Yes, it really is meant to be TestIntfUserException.
++ elif current.operation == "intfUserException":
++ raise Test.TestImpossibleException() # Yes, it really is meant to be TestImpossibleException.
Deleted: trunk/dports/devel/ice-python/files/patch-config.Make.rules
===================================================================
--- trunk/dports/devel/ice-python/files/patch-config.Make.rules 2008-02-11 03:49:47 UTC (rev 34044)
+++ trunk/dports/devel/ice-python/files/patch-config.Make.rules 2008-02-11 03:56:11 UTC (rev 34045)
@@ -1,34 +0,0 @@
---- config/Make.rules.FCS 2007-03-01 14:11:25.000000000 -0500
-+++ config/Make.rules 2007-04-08 21:59:00.000000000 -0400
-@@ -18,7 +18,7 @@
- # if it does not exist.
- #
-
--prefix = /opt/IcePy-$(VERSION)
-+prefix ?= /opt/IcePy-$(VERSION)
-
- #
- # The "root directory" for runpath embedded in executables. Can be unset
-@@ -101,7 +101,7 @@
- SOVERSION = 32
- libdir = $(top_srcdir)/python
-
--install_slicedir = $(prefix)/slice
-+install_slicedir = $(prefix)/share/ice/slice
- install_pythondir = $(prefix)/python
-
- INSTALL = cp -fp
-@@ -132,11 +132,11 @@
- ICE_LIBS = $(ICE_LIB_DIRS) -lIce -lSlice -lIceUtil
-
- ifneq ($(ICE_HOME),)
-- ICE_FLAGS = -I$(ICE_HOME)/include
-+ ICE_FLAGS = -I$(ICE_HOME)/include/ice
- endif
-
- ifneq ($(ICE_HOME),)
-- slicedir = $(ICE_HOME)/slice
-+ slicedir = $(ICE_HOME)/share/ice/slice
- else
- slicedir = /usr/share/Ice-$(VERSION)/slice
- endif
Deleted: trunk/dports/devel/ice-python/files/patch-config.Make.rules.Darwin
===================================================================
--- trunk/dports/devel/ice-python/files/patch-config.Make.rules.Darwin 2008-02-11 03:49:47 UTC (rev 34044)
+++ trunk/dports/devel/ice-python/files/patch-config.Make.rules.Darwin 2008-02-11 03:56:11 UTC (rev 34045)
@@ -1,22 +0,0 @@
---- config/Make.rules.Darwin.FCS 2007-01-08 14:25:09.000000000 -0500
-+++ config/Make.rules.Darwin 2007-04-08 22:22:38.000000000 -0400
-@@ -23,9 +23,9 @@
- endif
-
- PYTHON_INCLUDE_DIR = $(PYTHON_HOME)/include/$(PYTHON_VERSION)
--PYTHON_LIBS = -F$(PYTHON_HOME) -framework Python
-+PYTHON_LIBS = -F$(prefix)/Library/Frameworks -framework Python
-
--CXX = c++
-+CXX ?= c++
-
- CXXFLAGS = -ftemplate-depth-128 -Wall -D_REENTRANT
-
-@@ -49,6 +49,6 @@
- BASELIBS = -lIceUtil -lpthread
- LIBS = -lIce $(BASELIBS)
-
--PLATFORM_HAS_READLINE := no
-+PLATFORM_HAS_READLINE := yes
-
- export DYLD_LIBRARY_PATH := $(libdir):$(DYLD_LIBRARY_PATH)
Copied: trunk/dports/devel/ice-python/files/patch-config.Make.rules.Darwin.diff (from rev 34039, trunk/dports/devel/ice-python/files/patch-config.Make.rules.Darwin)
===================================================================
--- trunk/dports/devel/ice-python/files/patch-config.Make.rules.Darwin.diff (rev 0)
+++ trunk/dports/devel/ice-python/files/patch-config.Make.rules.Darwin.diff 2008-02-11 03:56:11 UTC (rev 34045)
@@ -0,0 +1,22 @@
+--- config/Make.rules.Darwin.FCS 2007-01-08 14:25:09.000000000 -0500
++++ config/Make.rules.Darwin 2007-04-08 22:22:38.000000000 -0400
+@@ -23,9 +23,9 @@
+ endif
+
+ PYTHON_INCLUDE_DIR = $(PYTHON_HOME)/include/$(PYTHON_VERSION)
+-PYTHON_LIBS = -F$(PYTHON_HOME) -framework Python
++PYTHON_LIBS = -F$(prefix)/Library/Frameworks -framework Python
+
+-CXX = c++
++CXX ?= c++
+
+ CXXFLAGS = -ftemplate-depth-128 -Wall -D_REENTRANT
+
+@@ -49,6 +49,6 @@
+ BASELIBS = -lIceUtil -lpthread
+ LIBS = -lIce $(BASELIBS)
+
+-PLATFORM_HAS_READLINE := no
++PLATFORM_HAS_READLINE := yes
+
+ export DYLD_LIBRARY_PATH := $(libdir):$(DYLD_LIBRARY_PATH)
Copied: trunk/dports/devel/ice-python/files/patch-config.Make.rules.diff (from rev 34039, trunk/dports/devel/ice-python/files/patch-config.Make.rules)
===================================================================
--- trunk/dports/devel/ice-python/files/patch-config.Make.rules.diff (rev 0)
+++ trunk/dports/devel/ice-python/files/patch-config.Make.rules.diff 2008-02-11 03:56:11 UTC (rev 34045)
@@ -0,0 +1,34 @@
+--- config/Make.rules.FCS 2007-03-01 14:11:25.000000000 -0500
++++ config/Make.rules 2007-04-08 21:59:00.000000000 -0400
+@@ -18,7 +18,7 @@
+ # if it does not exist.
+ #
+
+-prefix = /opt/IcePy-$(VERSION)
++prefix ?= /opt/IcePy-$(VERSION)
+
+ #
+ # The "root directory" for runpath embedded in executables. Can be unset
+@@ -101,7 +101,7 @@
+ SOVERSION = 32
+ libdir = $(top_srcdir)/python
+
+-install_slicedir = $(prefix)/slice
++install_slicedir = $(prefix)/share/ice/slice
+ install_pythondir = $(prefix)/python
+
+ INSTALL = cp -fp
+@@ -132,11 +132,11 @@
+ ICE_LIBS = $(ICE_LIB_DIRS) -lIce -lSlice -lIceUtil
+
+ ifneq ($(ICE_HOME),)
+- ICE_FLAGS = -I$(ICE_HOME)/include
++ ICE_FLAGS = -I$(ICE_HOME)/include/ice
+ endif
+
+ ifneq ($(ICE_HOME),)
+- slicedir = $(ICE_HOME)/slice
++ slicedir = $(ICE_HOME)/share/ice/slice
+ else
+ slicedir = /usr/share/Ice-$(VERSION)/slice
+ endif
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://lists.macosforge.org/pipermail/macports-changes/attachments/20080210/c6a46cc5/attachment-0001.html
More information about the macports-changes
mailing list