Commits

Amaury Forgeot d'Arc committed 6dd3cc7

Fix translation

  • Participants
  • Parent commits 612464a
  • Branches py3k

Comments (0)

Files changed (1)

File pypy/module/cpyext/buffer.py

         self.c_len = c_len
         self.w_obj = w_obj
 
-    def __del__(self):
+    def destructor(self):
+        assert isinstance(self, CBufferMixin)
         Py_DecRef(self.space, self.w_obj)
 
     def getlength(self):
         return self.c_buf[index]
 
     def as_str(self):
-        return rffi.charpsize2str(self.c_buf, self.c_len)
+        return rffi.charpsize2str(rffi.cast(rffi.CCHARP, self.c_buf),
+                                  self.c_len)
         
 class CBuffer(CBufferMixin, buffer.Buffer):
-    pass
+    def __del__(self):
+        self.enqueue_for_destruction(self.space, CBufferMixin.destructor,
+                                     'internal __del__ of ')