Skip to content

Commit 1098d1d

Browse files
committed
tests/basics/memoryview_itemsize: Make portable to 32- and 64-bit archs.
1 parent 33b0a7e commit 1098d1d

File tree

1 file changed

+4
-1
lines changed

1 file changed

+4
-1
lines changed

tests/basics/memoryview_itemsize.py

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -12,9 +12,12 @@
1212
print("SKIP")
1313
raise SystemExit
1414

15-
for code in ['b', 'h', 'i', 'l', 'q', 'f', 'd']:
15+
for code in ['b', 'h', 'i', 'q', 'f', 'd']:
1616
print(memoryview(array(code)).itemsize)
1717

18+
# 'l' varies depending on word size of the machine
19+
print(memoryview(array('l')).itemsize in (4, 8))
20+
1821
# shouldn't be able to store to the itemsize attribute
1922
try:
2023
memoryview(b'a').itemsize = 1

0 commit comments

Comments
 (0)