Issue1006
Created on 2008-03-07.04:42:19 by tristan, last changed 2008-03-08.05:54:20 by pjenvey.
msg3065 (view) |
Author: Tristan King (tristan) |
Date: 2008-03-07.04:42:18 |
|
when using __import__ with a fromlist, the modules in fromlist should be
added to the imported module's __dict__. It doesn't.
Example:
$ mkdir a
$ mkdir a/b
$ mkdir a/b/c
$ touch a/__init__.py
$ touch a/b/__init__.py
$ touch a/b/c/__init__.py
$ python -c "print __import__('a.b', {}, {}, ('c',)).c"
<module 'a.b.c' from 'a/b/c/__init__.pyc'>
tristan@quiver:~/projects/tmp/test$ jython -c "print __import__('a.b',
{}, {}, ('c',)).c"
Traceback (innermost last):
File "<string>", line 1, in ?
AttributeError: 'module' object has no attribute 'c'
|
msg3066 (view) |
Author: Philip Jenvey (pjenvey) |
Date: 2008-03-07.06:15:44 |
|
This was broke by my r4188 when I removed the getattr on a module
automatically triggering an import (which is more correct). it exposed a
bug in __import__ -- it totally ignores the fromlist =[
>>> __import__('a.b',{}, {}, ('c',))
<module 'a.b' from 'a/b/__init__.py'>
>>> assert 'a.b.c' in sys.modules
Traceback (innermost last):
File "<console>", line 1, in ?
AssertionError:
|
msg3071 (view) |
Author: Philip Jenvey (pjenvey) |
Date: 2008-03-08.05:54:20 |
|
fixed in r4193
|
|
Date |
User |
Action |
Args |
2008-03-08 05:54:21 | pjenvey | set | status: open -> closed resolution: fixed messages:
+ msg3071 |
2008-03-07 06:35:14 | pjenvey | set | priority: urgent |
2008-03-07 06:15:45 | pjenvey | set | assignee: pjenvey messages:
+ msg3066 severity: major -> urgent nosy:
+ pjenvey |
2008-03-07 04:42:19 | tristan | create | |
|