Author: Antonio Cuni <anto.c...@gmail.com> Branch: py3k Changeset: r55222:2f0431a1e9c9 Date: 2012-05-31 11:57 +0200 http://bitbucket.org/pypy/pypy/changeset/2f0431a1e9c9/
Log: hg merge default diff --git a/pypy/module/_socket/test/test_sock_app.py b/pypy/module/_socket/test/test_sock_app.py --- a/pypy/module/_socket/test/test_sock_app.py +++ b/pypy/module/_socket/test/test_sock_app.py @@ -622,11 +622,13 @@ buf = t.recv(1) assert buf == b'?' # test send() timeout + count = 0 try: while 1: - cli.send(b'foobar' * 70) + count += cli.send(b'foobar' * 70) except timeout: pass + t.recv(count) # test sendall() timeout, be sure to send data larger than the # socket buffer raises(timeout, cli.sendall, b'foobar' * 7000) 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 @@ -229,19 +229,6 @@ def _to_bytes(space, w_bytearray): return space.wrapbytes(''.join(w_bytearray.data)) -def str_count__Bytearray_Long_ANY_ANY(space, w_bytearray, w_char, w_start, w_stop): - char = w_char.intval - bytearray = w_bytearray.data - length = len(bytearray) - start, stop = slicetype.unwrap_start_stop( - space, length, w_start, w_stop, False) - count = 0 - for i in range(start, min(stop, length)): - c = w_bytearray.data[i] - if ord(c) == char: - count += 1 - return space.wrap(count) - def str_count__Bytearray_ANY_ANY_ANY(space, w_bytearray, w_char, w_start, w_stop): w_char = space.wrapbytes(space.bufferstr_new_w(w_char)) w_str = _to_bytes(space, w_bytearray) diff --git a/pypy/objspace/std/longtype.py b/pypy/objspace/std/longtype.py --- a/pypy/objspace/std/longtype.py +++ b/pypy/objspace/std/longtype.py @@ -51,7 +51,10 @@ base = space.int_w(w_base) if space.isinstance_w(w_value, space.w_unicode): - from pypy.objspace.std.unicodeobject import unicode_to_decimal_w + if space.config.objspace.std.withropeunicode: + from pypy.objspace.std.ropeunicodeobject import unicode_to_decimal_w + else: + from pypy.objspace.std.unicodeobject import unicode_to_decimal_w s = unicode_to_decimal_w(space, w_value) else: try: diff --git a/pypy/objspace/std/test/test_bytearrayobject.py b/pypy/objspace/std/test/test_bytearrayobject.py --- a/pypy/objspace/std/test/test_bytearrayobject.py +++ b/pypy/objspace/std/test/test_bytearrayobject.py @@ -163,7 +163,6 @@ assert bytearray(b'hello').count(b'l') == 2 assert bytearray(b'hello').count(bytearray(b'l')) == 2 assert bytearray(b'hello').count(memoryview(b'l')) == 2 - assert bytearray(b'hello').count(ord('l')) == 2 assert bytearray(b'hello').index(b'e') == 1 assert bytearray(b'hello').rindex(b'l') == 3 diff --git a/pypy/objspace/std/test/test_unicodeobject.py b/pypy/objspace/std/test/test_unicodeobject.py --- a/pypy/objspace/std/test/test_unicodeobject.py +++ b/pypy/objspace/std/test/test_unicodeobject.py @@ -262,6 +262,7 @@ def test_long_from_unicode(self): assert int('12345678901234567890') == 12345678901234567890 + assert int('123', 7) == 66 def test_int_from_unicode(self): assert int('12345') == 12345 _______________________________________________ pypy-commit mailing list pypy-commit@python.org http://mail.python.org/mailman/listinfo/pypy-commit