force highest protocol

This commit is contained in:
Will McGugan
2022-05-13 16:52:15 +01:00
parent f26d917a72
commit 53837c1a81
3 changed files with 4 additions and 4 deletions

View File

@@ -248,5 +248,5 @@ class DevtoolsClient:
Returns: Returns:
bytes: The Segment list pickled with the latest protocol. bytes: The Segment list pickled with the latest protocol.
""" """
pickled = pickle.dumps(segments, protocol=3) pickled = pickle.dumps(segments, protocol=4)
return pickled return pickled

View File

@@ -41,7 +41,7 @@ async def test_devtools_log_places_encodes_and_queues_message(devtools):
"timestamp": 1649170419, "timestamp": 1649170419,
"path": "a/b/c.py", "path": "a/b/c.py",
"line_number": 123, "line_number": 123,
"segments": b"\x80\x03]q\x00(crich.segment\nSegment\nq\x01X\r\x00\x00\x00Hello, world!q\x02NN\x87q\x03\x81q\x04h\x01X\x01\x00\x00\x00\nq\x05NN\x87q\x06\x81q\x07e.", "segments": b"\x80\x04\x95B\x00\x00\x00\x00\x00\x00\x00]\x94(\x8c\x0crich.segment\x94\x8c\x07Segment\x94\x93\x94\x8c\rHello, world!\x94NN\x87\x94\x81\x94h\x03\x8c\x01\n\x94NN\x87\x94\x81\x94e.",
}, },
} }
@@ -59,7 +59,7 @@ async def test_devtools_log_places_encodes_and_queues_many_logs_as_string(devtoo
"timestamp": 1649170419, "timestamp": 1649170419,
"path": "a/b/c.py", "path": "a/b/c.py",
"line_number": 123, "line_number": 123,
"segments": b"\x80\x03]q\x00(crich.segment\nSegment\nq\x01X\x0b\x00\x00\x00hello worldq\x02NN\x87q\x03\x81q\x04h\x01X\x01\x00\x00\x00\nq\x05NN\x87q\x06\x81q\x07e.", "segments": b"\x80\x04\x95@\x00\x00\x00\x00\x00\x00\x00]\x94(\x8c\x0crich.segment\x94\x8c\x07Segment\x94\x93\x94\x8c\x0bhello world\x94NN\x87\x94\x81\x94h\x03\x8c\x01\n\x94NN\x87\x94\x81\x94e.",
}, },
} }

View File

@@ -28,7 +28,7 @@ async def test_print_redirect_to_devtools_only(devtools):
assert payload["timestamp"] == TIMESTAMP assert payload["timestamp"] == TIMESTAMP
assert ( assert (
payload["segments"] payload["segments"]
== b"\x80\x03]q\x00(crich.segment\nSegment\nq\x01X\r\x00\x00\x00Hello, world!q\x02NN\x87q\x03\x81q\x04h\x01X\x01\x00\x00\x00\nq\x05NN\x87q\x06\x81q\x07e." == b"\x80\x04\x95B\x00\x00\x00\x00\x00\x00\x00]\x94(\x8c\x0crich.segment\x94\x8c\x07Segment\x94\x93\x94\x8c\rHello, world!\x94NN\x87\x94\x81\x94h\x03\x8c\x01\n\x94NN\x87\x94\x81\x94e."
) )