[omniORB] omniORB and Python 2.3
Andreas Voegele
voegelas at gmx.net
Fri Aug 8 23:53:55 BST 2003
Python 2.3 has a new boolean type (see http://www.python.org/peps/pep-0285.html).
One of the differences is that str() and repr() now return False and
True instead of 0 and 1 if a boolean value is passed to these
functions. int() converts boolean values into integer values, i.e.
int(False) returns 0 and int(True) returns 1.
I couldn't build Fresco without the following patch:
--- omniORB-4.0.2.orig/src/lib/omniORB/omniidl_be/cxx/skel/main.py 2001-10-29 18:42:41.000000000 +0100
+++ omniORB-4.0.2/src/lib/omniORB/omniidl_be/cxx/skel/main.py 2003-08-08 20:39:04.000000000 +0200
@@ -527,7 +527,7 @@
marshal_cases.out("break;")
unmarshal_cases.inc_indent()
- unmarshal_cases.out("_pd__default = " + str(isDefault) + ";")
+ unmarshal_cases.out("_pd__default = " + str(int(isDefault)) + ";")
skutil.unmarshall(unmarshal_cases, environment,
caseType, decl, "_pd_" + decl_name, "_n")
unmarshal_cases.dec_indent()
Without this patch main.py outputs "_pd__default = False;" instead of
"_pd__default = 0;" to C++ files.
There may be other files that have to be updated. For example, in
omniORB-4.0.2/src/lib/omniORB/omniidl_be/cxx/header/defs.py the
following statement occurrs several times: isDefault = str(c.isDefault)
More information about the omniORB-list
mailing list