[omniORB] CORBA.is_nil in Python

Viktor Kerkez viktor.kerkez at dmsgroup.rs
Tue Oct 14 16:57:35 BST 2008


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.



More information about the omniORB-list mailing list