1. Pypy
  2. Untitled project
  3. pypy


Hakan Ardo  committed 1ca4ac0 Merge

hg merge default

  • Participants
  • Parent commits f4cbb97, 95d2ecd
  • Branches jit-short_from_state

Comments (0)

Files changed (6)

File pypy/interpreter/pyframe.py

View file
     escaped                  = False  # see mark_as_escaped()
     def __init__(self, space, code, w_globals, closure):
+        if not we_are_translated():
+            assert type(self) in (space.FrameClass, CPythonFrame), (
+                "use space.FrameClass(), not directly PyFrame()")
         self = hint(self, access_directly=True, fresh_virtualizable=True)
         assert isinstance(code, pycode.PyCode)
         self.pycode = code

File pypy/module/cpyext/frameobject.py

View file
     code = space.interp_w(PyCode, w_code)
     w_globals = from_ref(space, py_frame.c_f_globals)
-    frame = PyFrame(space, code, w_globals, closure=None)
+    frame = space.FrameClass(space, code, w_globals, closure=None)
     frame.f_lineno = py_frame.c_f_lineno
     w_obj = space.wrap(frame)
     track_reference(space, py_obj, w_obj)

File pypy/module/oracle/interp_connect.py

View file
         return space.wrap(self)
     def __del__(self):
+        self.enqueue_for_destruction(self.environment.space,
+                                     W_Connection.destructor,
+                                     '__del__ method of ')
+    def destructor(self):
+        assert isinstance(self, W_Connection)
         if self.release:
                 self.handle, self.environment.errorHandle,

File pypy/module/oracle/interp_object.py

View file
         self.initialize(connection, param)
     def __del__(self):
+        self.enqueue_for_destruction(self.environment.space,
+                                     W_ObjectType.destructor,
+                                     '__del__ method of ')
+    def destructor(self):
+        assert isinstance(self, W_ObjectType)
         if self.tdo:

File pypy/module/oracle/interp_variable.py

View file
         self.initialize(self.environment.space, cursor)
     def __del__(self):
+        self.enqueue_for_destruction(self.environment.space,
+                                     W_Variable.destructor,
+                                     '__del__ method of ')
+    def destructor(self):
+        assert isinstance(self, W_Variable)
         lltype.free(self.actualElementsPtr, flavor='raw')
         if self.actualLength:

File pypy/tool/pytest/test/test_pytestsupport.py

View file
 from pypy.interpreter.gateway import app2interp_temp
 from pypy.interpreter.argument import Arguments
 from pypy.interpreter.pycode import PyCode
-from pypy.interpreter.pyframe import PyFrame
 from pypy.tool.pytest.appsupport import (AppFrame, build_pytest_assertion,
     AppExceptionInfo, interpret)
 import py
 def test_AppFrame(space):
     import sys
     co = PyCode._from_code(space, somefunc.func_code)
-    pyframe = PyFrame(space, co, space.newdict(), None)
+    pyframe = space.FrameClass(space, co, space.newdict(), None)
     runner = AppFrame(space, pyframe)
     interpret("f = lambda x: x+1", runner, should_fail=False)
     msg = interpret("assert isinstance(f(2), float)", runner)