tests/basics: Use bytes not bytearray when checking user buffer proto.

Using bytes will test the same path for the buffer protocol in
py/objtype.c.
pull/5227/head
Damien George 2019-10-29 21:25:38 +11:00
rodzic aeea204e98
commit 9162a87d4d
2 zmienionych plików z 3 dodań i 3 usunięć

Wyświetl plik

@ -4,6 +4,6 @@ class C:
c = C()
try:
d = bytearray(c)
d = bytes(c)
except TypeError:
print('TypeError')

Wyświetl plik

@ -12,5 +12,5 @@ print(b1 + b2)
print(b1 + b3)
print(b3 + b1)
# bytearray construction will use the buffer protocol
print(bytearray(b1))
# bytes construction will use the buffer protocol
print(bytes(b1))