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

fijal at codespeak.net fijal at codespeak.net
Sat Feb 16 14:15:03 CET 2008


Author: fijal
Date: Sat Feb 16 14:15:03 2008
New Revision: 51554

Modified:
   pypy/dist/pypy/lib/_ctypes/array.py
Log:
it seems to be the case in ctypes that from_param returns self if it's
of the right type.


Modified: pypy/dist/pypy/lib/_ctypes/array.py
==============================================================================
--- pypy/dist/pypy/lib/_ctypes/array.py	(original)
+++ pypy/dist/pypy/lib/_ctypes/array.py	Sat Feb 16 14:15:03 2008
@@ -72,6 +72,9 @@
 
     def from_param(self, value):
         # check for iterable
+        # shortcut
+        if isinstance(value, self):
+            return value
         try:
             iter(value)
         except ValueError:



More information about the Pypy-commit mailing list