[pypy-svn] r51529 - pypy/dist/pypy/lib/_ctypes

pedronis at codespeak.net pedronis at codespeak.net
Fri Feb 15 14:31:07 CET 2008


Author: pedronis
Date: Fri Feb 15 14:31:06 2008
New Revision: 51529

Modified:
   pypy/dist/pypy/lib/_ctypes/basics.py
   pypy/dist/pypy/lib/_ctypes/pointer.py
Log:
in this case index and base where not really going anywhere



Modified: pypy/dist/pypy/lib/_ctypes/basics.py
==============================================================================
--- pypy/dist/pypy/lib/_ctypes/basics.py	(original)
+++ pypy/dist/pypy/lib/_ctypes/basics.py	Fri Feb 15 14:31:06 2008
@@ -17,15 +17,13 @@
         else:
             return self.from_param(as_parameter)
 
-    def _CData_input(self, value, base=None, index=-1):
+    def _CData_input(self, value):
         """Used when data enters into ctypes from user code.  'value' is
         some user-specified Python object, which is converted into a _rawffi
         array of length 1 containing the same value according to the
         type 'self'.
         """
         cobj = self.from_param(value)
-        cobj.__dict__['_base'] = base
-        cobj.__dict__['_index'] = index
         return cobj._get_buffer_for_param()
 
     def _CData_output(self, resarray, base=None, index=-1):

Modified: pypy/dist/pypy/lib/_ctypes/pointer.py
==============================================================================
--- pypy/dist/pypy/lib/_ctypes/pointer.py	(original)
+++ pypy/dist/pypy/lib/_ctypes/pointer.py	Fri Feb 15 14:31:06 2008
@@ -98,8 +98,7 @@
         return self._type_._CData_output(self._subarray(index), self, index)
 
     def __setitem__(self, index, value):
-        self._subarray(index)[0] = self._type_._CData_input(value, self,
-                                                            index)[0]
+        self._subarray(index)[0] = self._type_._CData_input(value)[0]
 
     def __nonzero__(self):
         return self._buffer[0] != 0



More information about the Pypy-commit mailing list