[pypy-svn] r50872 - pypy/dist/pypy/lib/_ctypes
fijal at codespeak.net
fijal at codespeak.net
Tue Jan 22 13:54:39 CET 2008
Author: fijal
Date: Tue Jan 22 13:54:39 2008
New Revision: 50872
Modified:
pypy/dist/pypy/lib/_ctypes/array.py
Log:
Don't treat getslice on arrays as always returning strings (yay, test needed)
Modified: pypy/dist/pypy/lib/_ctypes/array.py
==============================================================================
--- pypy/dist/pypy/lib/_ctypes/array.py (original)
+++ pypy/dist/pypy/lib/_ctypes/array.py Tue Jan 22 13:54:39 2008
@@ -84,7 +84,10 @@
def _slice_getitem(self, index):
start, stop = self._get_slice_params(index)
- return "".join([self[i] for i in range(start, stop)])
+ l = [self[i] for i in range(start, stop)]
+ if getattr(self._type_, '_type_', None) == 'c':
+ return "".join(l)
+ return l
def _subarray(self, index):
"""Return a _rawffi array of length 1 whose address is the same as
More information about the Pypy-commit
mailing list