[pypy-commit] pypy default: get correct behavior on JVM

gutworth noreply at buildbot.pypy.org
Thu Mar 29 05:00:00 CEST 2012


Author: Benjamin Peterson <benjamin at python.org>
Branch: 
Changeset: r54053:ace5f809040a
Date: 2012-03-28 22:59 -0400
http://bitbucket.org/pypy/pypy/changeset/ace5f809040a/

Log:	get correct behavior on JVM

diff --git a/pypy/rpython/ootypesystem/rstr.py b/pypy/rpython/ootypesystem/rstr.py
--- a/pypy/rpython/ootypesystem/rstr.py
+++ b/pypy/rpython/ootypesystem/rstr.py
@@ -222,6 +222,8 @@
         length = s.ll_strlen()
         if stop > length:
             stop = length
+        if start > stop:
+            start = stop
         return s.ll_substring(start, stop-start)
 
     def ll_stringslice_minusone(s):


More information about the pypy-commit mailing list