[pypy-svn] r4955 - pypy/branch/src-newobjectmodel/pypy/module
arigo at codespeak.net
arigo at codespeak.net
Sat Jun 5 14:32:15 CEST 2004
Author: arigo
Date: Sat Jun 5 14:32:14 2004
New Revision: 4955
Modified:
pypy/branch/src-newobjectmodel/pypy/module/sysinterp.py
Log:
Just wrap the whole CPython module in a CPythonObject instead of emulating
it as a Module instance.
Modified: pypy/branch/src-newobjectmodel/pypy/module/sysinterp.py
==============================================================================
--- pypy/branch/src-newobjectmodel/pypy/module/sysinterp.py (original)
+++ pypy/branch/src-newobjectmodel/pypy/module/sysinterp.py Sat Jun 5 14:32:14 2004
@@ -12,16 +12,17 @@
def hack_cpython_module(modname):
"Steal a module from CPython."
cpy_module = __import__(modname, globals(), locals(), None)
- # to build the dictionary of the module, we get all the objects
- # accessible as 'self.xxx'. Methods are bound.
- contents = []
- for name in cpy_module.__dict__:
- # ignore names in '_xyz'
- if not name.startswith('_') or name.endswith('_'):
- value = cpy_module.__dict__[name]
- contents.append((space.wrap(name), space.wrap(value)))
- w_contents = space.newdict(contents)
- return Module(space, space.wrap(modname), w_contents)
+ return cpy_module
+## # to build the dictionary of the module, we get all the objects
+## # accessible as 'self.xxx'. Methods are bound.
+## contents = []
+## for name in cpy_module.__dict__:
+## # ignore names in '_xyz'
+## if not name.startswith('_') or name.endswith('_'):
+## value = cpy_module.__dict__[name]
+## contents.append((space.wrap(name), space.wrap(value)))
+## w_contents = space.newdict(contents)
+## return Module(space, space.wrap(modname), w_contents)
# ____________________________________________________________
#
More information about the Pypy-commit
mailing list