Message169506
I built a C extension using SWIG for both Python 3.2 and Python 3.3. The Python file supplying class proxies uses imp.load_module and fails with the following traceback on 3.3.0rc1, but works on 3.2.3:
Traceback (most recent call last):
File "<stdin>", line 1, in <module>
File ".\Widget.py", line 26, in <module>
_Widget = swig_import_helper()
File ".\Widget.py", line 22, in swig_import_helper
_mod = imp.load_module('_Widget', fp, pathname, description)
File "D:\dev\python33\lib\imp.py", line 171, in load_module
raise ImportError(msg, name=name)
ImportError: Don't know how to import _Widget (type code 3
It looks like imp.py is new in Python 3.3, and imp.load_module no longer supports the C_EXTENSION type. It looks like a regression.
To reproduce, I was able to run the following lines with the .pyd file in the current directory:
import imp
fp, pathname, description = imp.find_module('_Widget')
imp.load_module('_Widget', fp, pathname, description)
Nit: Also note the missing final ')' in the ImportError message. |
|
Date |
User |
Action |
Args |
2012-08-31 07:32:28 | metolone | set | recipients:
+ metolone |
2012-08-31 07:32:28 | metolone | set | messageid: <1346398348.83.0.242228991466.issue15828@psf.upfronthosting.co.za> |
2012-08-31 07:32:28 | metolone | link | issue15828 messages |
2012-08-31 07:32:26 | metolone | create | |
|