[omniORB] omniORBpy: order of import statements

Christof Meerwald cmeerw@web.de
Sun, 9 Dec 2001 14:45:08 +0100


Hi,

if I use the following 3 IDL files (a.idl, b.idl, c.idl):

// a.idl
module M
{
  interface A
  {
  };
};


// b.idl
#include "a.idl"

module N
{
  interface B
    : M::A
  {
  };
};


// c.idl
module M
{
  interface C
  {
  };
};


and then import the module N before module M into my Python script, the
Python module M doesn't contain all the expected elements:

$ python -c 'import N, M; print dir(M)'
['A', '__doc__', '__name__', '_d_A', '_objref_A', '_tc_A']

But if I reverse the order of import statements, I get the expected result:

$ python -c 'import M, N; print dir(M)'
['A', 'C', '__builtins__', '__doc__', '__file__', '__name__', '__path__',
'_d_A', '_d_C', '_objref_A', '_objref_C', '_tc_A', '_tc_C', 'a_idl', 'c_idl']


I guess the problem is that b_idl imports a_idl and creates the "M" module
in Python. The "import M" then has no effect because Python thinks it has
already imported the "M" module and therefore c_idl never gets imported.


BTW, I am using Linux 2.2.19, glibc 2.2.3, gcc 3.0.2, Python 2.1.1 and
omniORB 4/omniORBpy 2 preview:
OMNIORB_DIST_DATE "Tue Dec 4 14:29:26 GMT 2001 dpg1"
OMNIORBPY_DIST_DATE "Tue Dec 4 10:26:19 GMT 2001 dpg1"


bye, Christof

-- 
http://cmeerw.cjb.net                             JID: cmeerw@jabber.at
mailto cmeerw at web.de