Discussion:
[omniORB] CORBA.is_nil in Python
Viktor Kerkez
2008-10-14 19:58:03 UTC
Permalink
I just noticed that when i do (in C++):

orb_ref = CORBA::ORB_init(argc, argv);
if (CORBA::is_nil(orb_ref)) {
...
}

It works well, but when I try the sam thing in Python
orb = CORBA.ORB_init(sys.argv)
CORBA.is_nil(orb)
I get CORBA.BAD_PARAM(omniORB.BAD_PARAM_WrongPythonType,
CORBA.COMPLETED_NO).

I see that the implementation of is_nil is:

if obj is None:
return 1
if isinstance(obj, Object):
return 0
raise BAD_PARAM(omniORB.BAD_PARAM_WrongPythonType, COMPLETED_NO)

This is probably because the class ORB does not inherit the CORBA.Object.

Is this a valid behaviour.

Loading...