[pypy-svn] pypy bytearray: (lac, mfoord) assert in bytearray strip helper method for the sake of the annotator

mfoord commits-noreply at bitbucket.org
Thu Jan 20 18:44:09 CET 2011


Author: Michael Foord <michael at voidspace.org.uk>
Branch: bytearray
Changeset: r41059:c78cf01d651a
Date: 2011-01-20 18:43 +0100
http://bitbucket.org/pypy/pypy/changeset/c78cf01d651a/

Log:	(lac, mfoord) assert in bytearray strip helper method for the sake
	of the annotator

diff --git a/pypy/objspace/std/bytearrayobject.py b/pypy/objspace/std/bytearrayobject.py
--- a/pypy/objspace/std/bytearrayobject.py
+++ b/pypy/objspace/std/bytearrayobject.py
@@ -619,6 +619,7 @@
     if right:
         while rpos > lpos and u_self[rpos - 1] in u_chars:
             rpos -= 1
+        assert rpos >= 0
 
     return new_bytearray(space, space.w_bytearray, u_self[lpos:rpos])
 


More information about the Pypy-commit mailing list