[pypy-svn] r4973 - in pypy/branch/src-newobjectmodel/pypy: module objspace objspace/test

mwh at codespeak.net mwh at codespeak.net
Sat Jun 5 15:55:43 CEST 2004


Author: mwh
Date: Sat Jun  5 15:55:43 2004
New Revision: 4973

Modified:
   pypy/branch/src-newobjectmodel/pypy/module/__builtin__module.py
   pypy/branch/src-newobjectmodel/pypy/objspace/test/test_traceobjspace.py
   pypy/branch/src-newobjectmodel/pypy/objspace/trivial.py
Log:
minor fixes to/for trivial object space (no promises!)
fix test_traceobjspace


Modified: pypy/branch/src-newobjectmodel/pypy/module/__builtin__module.py
==============================================================================
--- pypy/branch/src-newobjectmodel/pypy/module/__builtin__module.py	(original)
+++ pypy/branch/src-newobjectmodel/pypy/module/__builtin__module.py	Sat Jun  5 15:55:43 2004
@@ -537,14 +537,16 @@
             return self.f(klass, *args)
         return newfunc
 
-def _fromkeys(cls, seq, value=None):
-    r = cls()
-    for s in seq:
-        r[s] = value
-    return r
+if not hasattr(dict, 'fromkeys'):
+    def _fromkeys(cls, seq, value=None):
+        r = cls()
+        for s in seq:
+            r[s] = value
+        return r
 
-dict.fromkeys = classmethod(_fromkeys)
-del _fromkeys
+    dict.fromkeys = classmethod(_fromkeys)
+
+    del _fromkeys
 
 
 # super is a modified version from Guido's tutorial

Modified: pypy/branch/src-newobjectmodel/pypy/objspace/test/test_traceobjspace.py
==============================================================================
--- pypy/branch/src-newobjectmodel/pypy/objspace/test/test_traceobjspace.py	(original)
+++ pypy/branch/src-newobjectmodel/pypy/objspace/test/test_traceobjspace.py	Sat Jun  5 15:55:43 2004
@@ -17,7 +17,7 @@
         func_gw = app2interp(app_func) 
         func = func_gw.get_function(tspace)
         tspace.settrace()
-        func() 
+        self.space.call_function(self.space.wrap(func))
         res = tspace.getresult()
         return res 
 

Modified: pypy/branch/src-newobjectmodel/pypy/objspace/trivial.py
==============================================================================
--- pypy/branch/src-newobjectmodel/pypy/objspace/trivial.py	(original)
+++ pypy/branch/src-newobjectmodel/pypy/objspace/trivial.py	Sat Jun  5 15:55:43 2004
@@ -114,11 +114,7 @@
                 setattr(self, 'w_' + c.__name__, c)
                 newstuff[c.__name__] = c
         newstuff.update(self.clone_exception_hierarchy())
-        self.make_builtins()
-        # insert these into the newly-made builtins
-        for key, w_value in newstuff.items():
-            self.w_builtins.setdefault(key, w_value)
-            # I'm tired of wrapping correctly here -- armin
+        self.make_builtins(newstuff)
 
     # general stuff
     def wrap(self, x):



More information about the Pypy-commit mailing list