Commit aee13ef3 authored by Paul Sokolovsky's avatar Paul Sokolovsky
Browse files

tests: Update for required byteorder arg for int.from_bytes()/to_bytes().

parent 9d787de2
try:
print((10).to_bytes(1, "big"))
except Exception as e:
print(type(e))
try:
print(int.from_bytes(b"\0", "big"))
except Exception as e:
print(type(e))
<class 'NotImplementedError'>
<class 'NotImplementedError'>
......@@ -14,7 +14,7 @@ desc = {
bytes = b"01"
addr = uctypes.addressof(bytes)
buf = addr.to_bytes(uctypes.sizeof(desc))
buf = addr.to_bytes(uctypes.sizeof(desc), "little")
S = uctypes.struct(uctypes.addressof(buf), desc, uctypes.LITTLE_ENDIAN)
......
......@@ -15,7 +15,7 @@ desc = {
bytes = b"01"
addr = uctypes.addressof(bytes)
buf = addr.to_bytes(uctypes.sizeof(desc))
buf = addr.to_bytes(uctypes.sizeof(desc), "little")
S = uctypes.struct(uctypes.addressof(buf), desc, uctypes.NATIVE)
......
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment