Author: Philip Jenvey <[email protected]>
Branch: py3k
Changeset: r70150:707e60600dbe
Date: 2014-03-21 16:48 -0700
http://bitbucket.org/pypy/pypy/changeset/707e60600dbe/

Log:    restore our buffer related error message

diff --git a/pypy/interpreter/baseobjspace.py b/pypy/interpreter/baseobjspace.py
--- a/pypy/interpreter/baseobjspace.py
+++ b/pypy/interpreter/baseobjspace.py
@@ -199,7 +199,8 @@
             w_result = space.get_and_call_function(w_impl, self)
             if space.isinstance_w(w_result, space.w_memoryview):
                 return w_result.buffer_w(space)
-        self._typed_unwrap_error(space, "buffer")
+        raise oefmt(space.w_TypeError,
+                    "'%T' does not support the buffer interface", self)
 
     def bytes_w(self, space):
         self._typed_unwrap_error(space, "bytes")
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
@@ -536,7 +536,8 @@
             skip("GAIError - probably no connection: %s" % str(ex.args))
         assert s.send(memoryview(b'')) == 0
         assert s.sendall(memoryview(b'')) is None
-        raises(TypeError, s.send, '')
+        exc = raises(TypeError, s.send, '')
+        assert str(exc.value) == "'str' does not support the buffer interface"
         raises(TypeError, s.sendall, '')
         s.close()
         s = _socket.socket(_socket.AF_INET, _socket.SOCK_DGRAM, 0)
_______________________________________________
pypy-commit mailing list
[email protected]
https://mail.python.org/mailman/listinfo/pypy-commit

Reply via email to