1993c8cf9a
CPython allows this and it's a simple generalisation of the existing code which just supported str/bytes. Fixes issue #5704.
13 lines
222 B
Python
13 lines
222 B
Python
# test builtin eval with a buffer (bytearray/memoryview) input
|
|
|
|
try:
|
|
eval
|
|
bytearray
|
|
memoryview
|
|
except:
|
|
print("SKIP")
|
|
raise SystemExit
|
|
|
|
print(eval(bytearray(b'1 + 1')))
|
|
print(eval(memoryview(b'2 + 2')))
|