Hello, On a PyPy I translated this morning, I'm seeing weird behavior importing a module that messes with sys.modules (not a nice thing to do, but I would still expect it to work): exarkun@boson:/tmp$ ls -lR trickypackage/ trickypackage/: total 4 -rw-r--r-- 1 exarkun exarkun 61 2010-01-09 11:39 foo.py -rw-r--r-- 1 exarkun exarkun 0 2010-01-09 11:40 __init__.py exarkun@boson:/tmp$ cat trickypackage/foo.py import sys sys.modules['trickypackage.foo'] = "Hello, world" exarkun@boson:/tmp$ python Python 2.6.4 (r264:75706, Dec 7 2009, 18:45:15) [GCC 4.4.1] on linux2 Type "help", "copyright", "credits" or "license" for more information.
from trickypackage import foo foo 'Hello, world'
exarkun@boson:/tmp$ ~/Projects/pypy/trunk/pypy/translator/goal/pypy-c-70469 Python 2.5.2 (70469, Jan 09 2010, 15:24:34) [PyPy 1.1.0] on linux2 Type "help", "copyright", "credits" or "license" for more information. And now for something completely different: ``PyPy doesn't change the fundamental physics constants''
from trickypackage import foo foo <module 'trickypackage.foo' from '/tmp/trickypackage/foo.py'>
Anyone have any idea why this might happen? The real problem this is causing for me is with the twisted.internet.reactor module, of course. Jean-Paul
2010/1/9 <exarkun@twistedmatrix.com>:
Anyone have any idea why this might happen? The real problem this is causing for me is with the twisted.internet.reactor module, of course.
Amaury's refactorings may have broken this. I've checked in a fix now. -- Regards, Benjamin
On 9 Jan, 11:51 pm, benjamin@python.org wrote:
2010/1/9 <exarkun@twistedmatrix.com>:
Anyone have any idea why this might happen? �The real problem this is causing for me is with the twisted.internet.reactor module, of course.
Amaury's refactorings may have broken this. I've checked in a fix now.
Thanks, your fix appears to have worked. Jean-Paul
participants (2)
-
Benjamin Peterson
-
exarkun@twistedmatrix.com