[pypy-svn] r9749 - pypy/dist/pypy/interpreter

pedronis at codespeak.net pedronis at codespeak.net
Fri Mar 11 19:31:30 CET 2005


Author: pedronis
Date: Fri Mar 11 19:31:29 2005
New Revision: 9749

Modified:
   pypy/dist/pypy/interpreter/pyopcode.py
Log:
sanity checks and assertion for lost PyCode types



Modified: pypy/dist/pypy/interpreter/pyopcode.py
==============================================================================
--- pypy/dist/pypy/interpreter/pyopcode.py	(original)
+++ pypy/dist/pypy/interpreter/pyopcode.py	Fri Mar 11 19:31:29 2005
@@ -9,6 +9,7 @@
 from pypy.interpreter import pyframe, pytraceback
 from pypy.interpreter.miscutils import InitializedClass
 from pypy.interpreter.argument import Arguments
+from pypy.interpreter.pycode import PyCode
 from pypy.tool import hack
 
 def unaryoperation(operationname):
@@ -357,6 +358,7 @@
         if plain:
             w_locals = f.getdictscope()
         pycode = f.space.interpclass_w(w_prog)
+        assert isinstance(pycode, PyCode)
         pycode.exec_code(f.space, w_globals, w_locals)
         if plain:
             f.setdictscope(w_locals)
@@ -655,7 +657,8 @@
 
     def MAKE_FUNCTION(f, numdefaults):
         w_codeobj = f.valuestack.pop()
-        codeobj = f.space.interpclass_w(w_codeobj)   
+        codeobj = f.space.interpclass_w(w_codeobj)
+        assert isinstance(codeobj, PyCode)        
         defaultarguments = [f.valuestack.pop() for i in range(numdefaults)]
         defaultarguments.reverse()
         fn = function.Function(f.space, codeobj, f.w_globals, defaultarguments)



More information about the Pypy-commit mailing list