Author: Armin Rigo <[email protected]>
Branch: unicode-utf8-re
Changeset: r93292:4ab5b6fa7557
Date: 2017-12-07 09:12 +0100
http://bitbucket.org/pypy/pypy/changeset/4ab5b6fa7557/

Log:    Translation fix (nonneg issues)

diff --git a/rpython/rlib/rsre/rsre_core.py b/rpython/rlib/rsre/rsre_core.py
--- a/rpython/rlib/rsre/rsre_core.py
+++ b/rpython/rlib/rsre/rsre_core.py
@@ -229,9 +229,10 @@
         return position + 1
 
     def prev(self, position):
-        if position == 0:
+        position -= 1
+        if position < 0:
             raise EndOfString
-        return position - 1
+        return position
 
     def next_n(self, position, n, end_position):
         position += n
_______________________________________________
pypy-commit mailing list
[email protected]
https://mail.python.org/mailman/listinfo/pypy-commit

Reply via email to