[omniORB] omniORBpy Exception Question (and omniidl exception patch).
Duncan Grisby
dgrisby@uk.research.att.com
Tue, 28 Mar 2000 10:32:40 +0100
On Monday 27 March, Randy Wiser wrote:
> Why do the stubs generated by omniidl inherit from class Exception
> in the standard Python module exceptions.py, but the generated
> __init__ methods fail to call the __init__ method
> (exceptions.Exception.__init__) in the class they inherit from?
There is, in fact, no reason for CORBA.Exception to be derived from
exceptions.Exception, so I have removed it. It doesn't do any harm to
inherit from exceptions.Exception, but it would be wrong to call its
__init__() method, since that would potentially overwrite exception
data members.
> I've attached a patch for the omniidl Python back-end (omniORB 3.0
> or 2.8) which seems to correct this, but I'm curious if it is the
> 'right thing' to do?
You patch was the wrong thing to do, since it broke for exceptions
with any data members. The correct thing to do is to remove
exceptions.Exception from the inheritance hierarchy, but as I say, it
doesn't actually hurt to have it there.
Thanks for pointing out the strangeness,
Duncan.
--
-- Duncan Grisby \ Research Engineer --
-- AT&T Laboratories Cambridge --
-- http://www.uk.research.att.com/~dpg1 --