[pypy-commit] pypy default: more places
cfbolz
noreply at buildbot.pypy.org
Fri Nov 4 10:50:23 CET 2011
Author: Carl Friedrich Bolz <cfbolz at gmx.de>
Branch:
Changeset: r48732:843cfd1d8ce5
Date: 2011-11-03 21:07 +0100
http://bitbucket.org/pypy/pypy/changeset/843cfd1d8ce5/
Log: more places
diff --git a/pypy/objspace/std/listobject.py b/pypy/objspace/std/listobject.py
--- a/pypy/objspace/std/listobject.py
+++ b/pypy/objspace/std/listobject.py
@@ -419,8 +419,8 @@
# needs to be safe against eq_w() mutating the w_list behind our back
items = w_list.wrappeditems
size = len(items)
- i = slicetype.adapt_bound(space, size, w_start)
- stop = slicetype.adapt_bound(space, size, w_stop)
+ i, stop = slicetype.unwrap_start_stop(
+ space, size, w_start, w_stop, True)
while i < stop and i < len(items):
if space.eq_w(items[i], w_any):
return space.wrap(i)
diff --git a/pypy/objspace/std/strsliceobject.py b/pypy/objspace/std/strsliceobject.py
--- a/pypy/objspace/std/strsliceobject.py
+++ b/pypy/objspace/std/strsliceobject.py
@@ -60,8 +60,8 @@
def _convert_idx_params(space, w_self, w_sub, w_start, w_end):
length = w_self.stop - w_self.start
sub = w_sub._value
- start = slicetype.adapt_bound(space, length, w_start)
- end = slicetype.adapt_bound(space, length, w_end)
+ start, end = slicetype.unwrap_start_stop(
+ space, length, w_start, w_end, True)
assert start >= 0
assert end >= 0
More information about the pypy-commit
mailing list