From: Kenneth H. <ken...@gm...> - 2013-02-01 21:33:37
|
The problem with this submission is that if the Python module built by SWIG is imported into the parent package in its __init__.py file, an error is generated such as: Traceback (most recent call last): ... File "../packages/foo/bar/\swig_generated.py", line xx, in <module> class Awesome(foo.bar.swig_generated.Wow): AttributeError: 'module' object has no attribute 'bar' Python is complaining that module foo.bar doesn't exist, and in fact it doesn't yet exist because it is in the process of being initialized. SWIG used to generate: import base_swig_generated.Wow class Awesome(swig_generated.Wow): but now generates import foo.bar.base_swig_generated.Wow class Awesome(foo.bar.swig_generated.Wow): This is an important issue for us because we want our consumers to import foo.bar, and not 'import foo.bar.swig_generated'--keeping the details of what parts are generated by SWIG hidden. |