m***@comcast.net
2016-04-04 17:30:01 UTC
I've been working on my patch to fix swig for implicit namespace
packages (https://github.com/swig/swig/pull/612). I now think I
understand the swig test suite a bit better and can reproduce the
failures of the travisci builds on my local machine.
In a nutshell, swig is generating this code inside the shadow class
of a module contained in a package:
...
del version_info
from _foo import *
try:
_swig_property = property
except NameError:
...
The 'from _foo import *' line is not compatible with python3 as it
uses a relative import (which are gone in py3). For python3 this
needs to be 'from ._foo import *' or 'from package._foo import *'.
Does anyone happen to know the approximate location in the swig code
where this 'from _foo import *' line is being generated? I'm going to
start my search in python.cxx. But any tips would be appreciated.
Thanks,
Mike
P.S. I rebased my git branch to see stuff in the swig tree. I fear
I've worked the git incantation in a non-ideal way. I'll cancel and
re-submit a pull request after the travisci builds are clean.
------------------------------------------------------------------------------
packages (https://github.com/swig/swig/pull/612). I now think I
understand the swig test suite a bit better and can reproduce the
failures of the travisci builds on my local machine.
In a nutshell, swig is generating this code inside the shadow class
of a module contained in a package:
...
del version_info
from _foo import *
try:
_swig_property = property
except NameError:
...
The 'from _foo import *' line is not compatible with python3 as it
uses a relative import (which are gone in py3). For python3 this
needs to be 'from ._foo import *' or 'from package._foo import *'.
Does anyone happen to know the approximate location in the swig code
where this 'from _foo import *' line is being generated? I'm going to
start my search in python.cxx. But any tips would be appreciated.
Thanks,
Mike
P.S. I rebased my git branch to see stuff in the swig tree. I fear
I've worked the git incantation in a non-ideal way. I'll cancel and
re-submit a pull request after the travisci builds are clean.
------------------------------------------------------------------------------