Kaydet (Commit) 92a62401 authored tarafından Antoine Pitrou's avatar Antoine Pitrou

Preemptively backport the relevant parts of r65420

üst 727bd0b6
......@@ -364,6 +364,9 @@ class StrTest(
self.assertRaises(ValueError, format, "", "-")
self.assertRaises(ValueError, "{0:=s}".format, '')
def test_buffer_is_readonly(self):
self.assertRaises(TypeError, sys.stdin.readinto, b"")
def test_main():
test_support.run_unittest(StrTest)
......
......@@ -1329,7 +1329,7 @@ static int
string_buffer_getbuffer(PyStringObject *self, Py_buffer *view, int flags)
{
return PyBuffer_FillInfo(view, (void *)self->ob_sval, Py_SIZE(self),
0, flags);
1, flags);
}
static PySequenceMethods string_as_sequence = {
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment