[pypy-svn] r77969 - pypy/branch/fast-forward/lib_pypy/_ctypes

afa at codespeak.net afa at codespeak.net
Fri Oct 15 11:08:43 CEST 2010


Author: afa
Date: Fri Oct 15 11:08:41 2010
New Revision: 77969

Modified:
   pypy/branch/fast-forward/lib_pypy/_ctypes/array.py
Log:
Fix ctypes tests


Modified: pypy/branch/fast-forward/lib_pypy/_ctypes/array.py
==============================================================================
--- pypy/branch/fast-forward/lib_pypy/_ctypes/array.py	(original)
+++ pypy/branch/fast-forward/lib_pypy/_ctypes/array.py	Fri Oct 15 11:08:41 2010
@@ -109,15 +109,16 @@
 def array_get_slice_params(self, index):
     if index.step is not None:
         raise TypeError("3 arg slices not supported (for no reason)")
+    check_bounds = hasattr(self, '_length_')
     if index.start is not None:
         start = index.start
-        if start < 0:
+        if check_bounds and start < 0:
             start = 0
     else:
         start = 0
     if index.stop is not None:
         stop = index.stop
-        if stop > self._length_:
+        if check_bounds and stop > self._length_:
             stop = self._length_
     else:
         stop = self._length_



More information about the Pypy-commit mailing list