[omniORB] omniORBpy and special method names

Duncan Grisby duncan at grisby.org
Mon Feb 16 14:04:01 GMT 2004


On Thursday 12 February, =?iso-8859-1?q?Ga=EBl_Le_Mignot?= wrote:

> I'm using  omniorb with  Python. When,  in the IDL,  a method  name is
> Python keyword  (like 'del')  the method should  be renamed with  an _
> (like '_del'). But I get  a CORBA exception (BadOperation) when I call
> it.

That is indeed a bug. I'm amazed nobody has noticed it before. I've
fixed it in CVS. I've included the patch here.

Cheers,

Duncan.

--- python.py   19 Nov 2003 16:56:36 -0000      1.29.2.17
+++ python.py   16 Feb 2004 13:56:06 -0000      1.29.2.18
@@ -26,8 +26,11 @@
 #   
 #   Back-end for Python
 
-# $Id: python.py,v 1.29.2.17 2003/11/19 16:56:36 dgrisby Exp $
+# $Id: python.py,v 1.29.2.18 2004/02/16 13:56:06 dgrisby Exp $
 # $Log: python.py,v $
+# Revision 1.29.2.18  2004/02/16 13:56:06  dgrisby
+# Operation names clashing with keywords were broken.
+#
 # Revision 1.29.2.17  2003/11/19 16:56:36  dgrisby
 # Extern package option to omniidl backend. Thanks Rene Jager.
 #
@@ -311,7 +314,7 @@
         return _omnipy.invoke(self, "_set_ at attr@", _0_ at modname@. at ifid@._d__set_ at attr@, args)"""
 objref_operation = """
     def @opname@(self, *args):
-        return _omnipy.invoke(self, "@opname@", _0_ at modname@. at ifid@._d_ at opname@, args)"""
+        return _omnipy.invoke(self, "@r_opname@", _0_ at modname@. at ifid@._d_ at opname@, args)"""
 objref_methods = """
     __methods__ = @methods@"""
 
@@ -1022,9 +1025,10 @@
                 opname = mangle(c.identifier())
                 
                 self.st.out(objref_operation,
-                            opname  = opname,
-                            ifid    = ifid,
-                            modname = self.modname)
+                            opname   = opname,
+                            r_opname = c.identifier(),
+                            ifid     = ifid,
+                            modname  = self.modname)
                 
                 methodl.append('"' + opname + '"')
 


-- 
 -- Duncan Grisby         --
  -- duncan at grisby.org     --
   -- http://www.grisby.org --



More information about the omniORB-list mailing list