bpo-34201: Tweak test_buffer. (GH-8481)

This commit is contained in:
Serhiy Storchaka 2018-07-26 17:34:07 +03:00 committed by GitHub
parent d145775b45
commit 3b5342caaa
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 2 additions and 3 deletions

View File

@ -765,8 +765,7 @@ class TestBufferProtocol(unittest.TestCase):
itemsize, fmt, readonly,
ndim, shape, strides,
lst, sliced=False, cast=False):
# Verify buffer contents against expected values. Default values
# are deliberately initialized to invalid types.
# Verify buffer contents against expected values.
if shape:
expected_len = prod(shape)*itemsize
else:
@ -978,7 +977,7 @@ class TestBufferProtocol(unittest.TestCase):
lst = nd.tolist()
# The consumer may have requested default values or a NULL format.
ro = not match(req, PyBUF_WRITABLE) and ex.readonly
ro = False if match(req, PyBUF_WRITABLE) else ex.readonly
fmt = ex.format
itemsize = ex.itemsize
ndim = ex.ndim