Archived
This forum has been archived. Please start a new discussion on GitHub.
slice2py --no-package problem
mmarquar
in Help Center
The following code worked under ice 3.3 but under 3.4 fails with an ImportError. According to the manual thsi should still work.
I have tested this under both linux and OS X. Is anyone else seeing the same problem?!
ImportError: No module named example
cat example.ice
module example
{
enum Useful
{
A,
B,
C
};
};
slice2py --no-package example.ice
cat test.py
import Ice
import example_ice
import example
python test.py
I have tested this under both linux and OS X. Is anyone else seeing the same problem?!
0
Comments
-
Hi,
We did make some changes in Ice 3.4 to address the issue reported here that would cause the behavior you are seeing.
You can solve this by creating example.py that contains the following:# example.py import example_ice
Another option is to call the undocumented function Ice.updateModules:# test.py import Ice import example_ice Ice.updateModules() import example
Of course, there's the usual caveat that a subsequent Ice release can break applications that use undocumented APIs.
Regards,
Mark0 -
I don't quite understand how the first example would work any different to the way it is broken now.
I have nested modules and do the following at the moment as part of a python module which contains the generated _ice.py files.from . import MyInterfaces_ice import a.b.c from a.b.c import ExampleInterface ...
0
