[pypy-svn] rev 567 - pypy/trunk/src/pypy/objspace

alex at codespeak.net alex at codespeak.net
Tue May 27 15:59:43 CEST 2003


Author: alex
Date: Tue May 27 15:59:43 2003
New Revision: 567

Modified:
   pypy/trunk/src/pypy/objspace/trivial.py
Log:
minor fixes



Modified: pypy/trunk/src/pypy/objspace/trivial.py
==============================================================================
--- pypy/trunk/src/pypy/objspace/trivial.py	(original)
+++ pypy/trunk/src/pypy/objspace/trivial.py	Tue May 27 15:59:43 2003
@@ -13,6 +13,7 @@
 
     def initialize(self):
         import __builtin__, types
+        self.builtin = __builtin__
         self.w_builtins.update(__builtin__.__dict__)
         for n, c in self.w_builtins.iteritems():
             if isinstance(c, types.ClassType) and issubclass(c, Exception):
@@ -171,6 +172,9 @@
             raise NoValue
 
     def newfunction(self, code, globals, defaultarguments, closure=None):
+        assert hasattr(code.co_name)
+        assert hasattr(code.build_arguments)
+        assert hasattr(code.eval_code)
         class nufun(object):
             def __init__(self, space, code, globals, defaultarguments, closure):
                 self.space = space
@@ -215,6 +219,6 @@
             return ec.eval_frame(frame)
         else:
             try:
-                return apply(callable, args, kwds)
+                return apply(callable, args, kwds or {})
             except:
                 raise OperationError(*sys.exc_info()[:2])


More information about the Pypy-commit mailing list