Author: Alex Gaynor <alex.gay...@gmail.com> Branch: Changeset: r50794:d84a162addff Date: 2011-12-20 22:54 -0600 http://bitbucket.org/pypy/pypy/changeset/d84a162addff/
Log: fix backwards logic diff --git a/pypy/objspace/std/stringobject.py b/pypy/objspace/std/stringobject.py --- a/pypy/objspace/std/stringobject.py +++ b/pypy/objspace/std/stringobject.py @@ -524,7 +524,8 @@ result_size = ovfcheck(upper * len(by)) result_size = ovfcheck(result_size + upper) result_size = ovfcheck(result_size + len(by)) - result_size = ovfcheck(result_size + upper - len(input)) + remaining_size = len(input) - upper + result_size = ovfcheck(result_size + remaining_size) except OverflowError: raise OperationError(space.w_OverflowError, space.wrap("replace string is too long") _______________________________________________ pypy-commit mailing list pypy-commit@python.org http://mail.python.org/mailman/listinfo/pypy-commit