◐ Shell
clean mode source ↗

Message 162364 - Python tracker

On 6/5/12 1:08 PM, Brett Cannon wrote:
>
> Brett Cannon<brett@python.org>  added the comment:
>
> Does it work in Python 3.2, John? If it does then it's just an oversight thanks to the lack of tests in test_imp and it shouldn't be too difficult to support.
>
> But do realize I have deprecated the function. =)

Attached is a short test file to demonstrate this.  It assumes the 
standard win32 layout, but shouldn't be hard to modify.  It does work in 
Python 3.2, but the else: clause in 3.3's imp.load_module function 
raises an ImportError.  I think the fix is to add an elif C_EXTENSION: 
clause that loads the .so / .pyd.

I've already rewritten my code to use importlib when running in Python 3.3.