Skip to content

Commit 7156623

Browse files
authored
Merge pull request #327 from python/master
bpo-39689: Do not test undefined casts to _Bool (pythonGH-18964)
2 parents 4f22523 + 1ae9cde commit 7156623

File tree

1 file changed

+4
-0
lines changed

1 file changed

+4
-0
lines changed

Lib/test/test_buffer.py

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2754,6 +2754,10 @@ def test_memoryview_cast_1D_ND(self):
27542754
# be 1D, at least one format must be 'c', 'b' or 'B'.
27552755
for _tshape in gencastshapes():
27562756
for char in fmtdict['@']:
2757+
# Casts to _Bool are undefined if the source contains values
2758+
# other than 0 or 1.
2759+
if char == "?":
2760+
continue
27572761
tfmt = ('', '@')[randrange(2)] + char
27582762
tsize = struct.calcsize(tfmt)
27592763
n = prod(_tshape) * tsize

0 commit comments

Comments
 (0)