[pypy-svn] r14180 - in pypy/dist/pypy: interpreter objspace/std
arigo at codespeak.net
arigo at codespeak.net
Sun Jul 3 20:13:53 CEST 2005
Author: arigo
Date: Sun Jul 3 20:13:47 2005
New Revision: 14180
Modified:
pypy/dist/pypy/interpreter/eval.py
pypy/dist/pypy/interpreter/gateway.py
pypy/dist/pypy/objspace/std/fake.py
Log:
Add a default hidden_applevel to all Code objects, as the ExecutionContext
assumes there is always one.
Type-checking in CPythonFakeFrame to prevent the 'cpy_callable' attribute from
being lifted to the base Code class by the annotator.
Modified: pypy/dist/pypy/interpreter/eval.py
==============================================================================
--- pypy/dist/pypy/interpreter/eval.py (original)
+++ pypy/dist/pypy/interpreter/eval.py Sun Jul 3 20:13:47 2005
@@ -9,6 +9,7 @@
class Code(Wrappable):
"""A code is a compiled version of some source code.
Abstract base class."""
+ hidden_applevel = False
def __init__(self, co_name):
self.co_name = co_name
Modified: pypy/dist/pypy/interpreter/gateway.py
==============================================================================
--- pypy/dist/pypy/interpreter/gateway.py (original)
+++ pypy/dist/pypy/interpreter/gateway.py Sun Jul 3 20:13:47 2005
@@ -332,6 +332,7 @@
class BuiltinCode(eval.Code):
"The code object implementing a built-in (interpreter-level) hook."
+ hidden_applevel = True
# When a BuiltinCode is stored in a Function object,
# you get the functionality of CPython's built-in function type.
Modified: pypy/dist/pypy/objspace/std/fake.py
==============================================================================
--- pypy/dist/pypy/objspace/std/fake.py (original)
+++ pypy/dist/pypy/objspace/std/fake.py Sun Jul 3 20:13:47 2005
@@ -142,13 +142,17 @@
self.unwrappedargs = self.space.unwrap(w_args)
self.unwrappedkwds = self.space.unwrap(w_kwds)
except UnwrapError, e:
- raise UnwrapError('calling %s: %s' % (self.code.cpy_callable, e))
+ code = self.code
+ assert isinstance(code, CPythonFakeCode)
+ raise UnwrapError('calling %s: %s' % (code.cpy_callable, e))
def getfastscope(self):
raise OperationError(self.space.w_TypeError,
self.space.wrap("cannot get fastscope of a CPythonFakeFrame"))
def run(self):
- fn = self.code.cpy_callable
+ code = self.code
+ assert isinstance(code, CPythonFakeCode)
+ fn = code.cpy_callable
try:
result = apply(fn, self.unwrappedargs, self.unwrappedkwds)
except:
More information about the Pypy-commit
mailing list