Closed GoogleCodeExporter closed 9 years ago
r1c55952f624f
- Modified IMPORT_NAME bytecode so new module uses the current globals
namespace.
- Added system test t378
Tests pass.
Original comment by dwhall...@gmail.com
on 2 Jan 2011 at 8:25
The committed changes broke ipm and compatibility with CPython. Backing out
this change and will attempt to fix this another way.
$ hg backout --merge -r 1c55952f62
r7f42525a071f
Tests pass. ipm passes.
$ hg ci
rbaeccda61be8
Original comment by dwhall...@gmail.com
on 8 Jan 2011 at 3:03
The summary is changed to reflect the new approach to solving this problem.
Instead of having modules share their global namespaces, the import system
should re-use modules. When a module is reused, its attributes (globals inside
the module) will be reused and that should solve this issue.
Original comment by dwhall...@gmail.com
on 9 Jan 2011 at 2:41
I've implemented a dict in the builtins module (__bi) to cache modules. The
dict is named "__md" (for "modules dict"). And I changed IMPORT_NAME to use a
module in __md if it exists and otherwise put a new module in __md.
I reinstated the same system test t378. The test passes with these changes.
However, because system heap was consumed with __md, t104 had to be modified
because it depends on a certain heap size to cause a GC.
I also modified t114.c because IMPORT now behaves differently and the VM now
properly raises an AttributeError for t114.py. This matches CPython.
Original comment by dwhall...@gmail.com
on 9 Jan 2011 at 2:51
r76c20922f040
tests pass. ipm passes.
Original comment by dwhall...@gmail.com
on 9 Jan 2011 at 3:51
Original comment by dwhall...@gmail.com
on 9 Jan 2011 at 3:52
Original issue reported on code.google.com by
dwhall...@gmail.com
on 26 Dec 2010 at 10:36