tests/basics/memoryview_itemsize: Make portable to 32- and 64-bit archs.
This commit is contained in:
parent
33b0a7e601
commit
1098d1d630
@ -12,9 +12,12 @@ except ImportError:
|
||||
print("SKIP")
|
||||
raise SystemExit
|
||||
|
||||
for code in ['b', 'h', 'i', 'l', 'q', 'f', 'd']:
|
||||
for code in ['b', 'h', 'i', 'q', 'f', 'd']:
|
||||
print(memoryview(array(code)).itemsize)
|
||||
|
||||
# 'l' varies depending on word size of the machine
|
||||
print(memoryview(array('l')).itemsize in (4, 8))
|
||||
|
||||
# shouldn't be able to store to the itemsize attribute
|
||||
try:
|
||||
memoryview(b'a').itemsize = 1
|
||||
|
Loading…
x
Reference in New Issue
Block a user