[pypy-svn] r50614 - pypy/branch/applevel-ctypes2/pypy/lib/_ctypes

arigo at codespeak.net arigo at codespeak.net
Mon Jan 14 20:07:25 CET 2008


Author: arigo
Date: Mon Jan 14 20:07:19 2008
New Revision: 50614

Modified:
   pypy/branch/applevel-ctypes2/pypy/lib/_ctypes/array.py
Log:
Tiny clean-ups.


Modified: pypy/branch/applevel-ctypes2/pypy/lib/_ctypes/array.py
==============================================================================
--- pypy/branch/applevel-ctypes2/pypy/lib/_ctypes/array.py	(original)
+++ pypy/branch/applevel-ctypes2/pypy/lib/_ctypes/array.py	Mon Jan 14 20:07:19 2008
@@ -16,9 +16,8 @@
                                                 self._length_)
                 def setvalue(self, val):
                     # we don't want to have buffers here
-                    import ctypes
                     if len(val) > self._length_:
-                        raise ValueError("%s too long" % (val,))
+                        raise ValueError("%r too long" % (val,))
                     for i in range(len(val)):
                         self[i] = val[i]
                     if len(val) < self._length_:
@@ -81,7 +80,6 @@
         return self._ffiarray.fromaddress(address, 1)
 
     def __setitem__(self, index, value):
-        from ctypes import _SimpleCData
         if isinstance(index, slice):
             self._slice_setitem(index, value)
             return



More information about the Pypy-commit mailing list