Author: Richard Plangger <[email protected]>
Branch: py3.5-ssl
Changeset: r88797:1d009c35c573
Date: 2016-12-01 15:33 +0100
http://bitbucket.org/pypy/pypy/changeset/1d009c35c573/
Log: failing test for memoryview slicing case
diff --git a/lib-python/3/http/client.py b/lib-python/3/http/client.py
--- a/lib-python/3/http/client.py
+++ b/lib-python/3/http/client.py
@@ -541,6 +541,7 @@
try:
while True:
chunk_left = self._get_chunk_left()
+ print("chunk_left", chunk_left)
if chunk_left is None:
break
value.append(self._safe_read(chunk_left))
@@ -590,6 +591,7 @@
s = []
while amt > 0:
chunk = self.fp.read(min(amt, MAXAMOUNT))
+ print("read chunk %d %d", len(chunk), min(amt, MAXAMOUNT))
if not chunk:
raise IncompleteRead(b''.join(s), amt)
s.append(chunk)
diff --git a/lib-python/3/socket.py b/lib-python/3/socket.py
--- a/lib-python/3/socket.py
+++ b/lib-python/3/socket.py
@@ -572,6 +572,7 @@
raise OSError("cannot read from timed out object")
while True:
try:
+ import pdb; pdb.set_trace()
return self._sock.recv_into(b)
except timeout:
self._timeout_occurred = True
diff --git a/pypy/objspace/std/test/test_memoryobject.py
b/pypy/objspace/std/test/test_memoryobject.py
--- a/pypy/objspace/std/test/test_memoryobject.py
+++ b/pypy/objspace/std/test/test_memoryobject.py
@@ -409,3 +409,10 @@
v = view.cast('h', shape=(3,2))
assert v.tolist() == [[2,3],[4,5],[6,7]]
raises(TypeError, "view.cast('h', shape=(3,3))")
+
+ def test_reversed(self):
+ bytes = b"\x01\x00\x02\x00\x03\x00"
+ view = memoryview(bytes)
+ revlist = list(reversed(view.tolist()))
+ assert list(reversed(view)) == revlist
+ assert list(reversed(view)) == view[::-1].tolist()
_______________________________________________
pypy-commit mailing list
[email protected]
https://mail.python.org/mailman/listinfo/pypy-commit