Skip to content

Commit ed17dd6

Browse files
Update sample code for python-hyper#124
1 parent 5465676 commit ed17dd6

File tree

1 file changed

+3
-3
lines changed

1 file changed

+3
-3
lines changed

docs/source/index.rst

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@ Working with it is easy:
88

99
.. code-block:: python
1010
11-
import hyperframe
11+
import hyperframe.frame
1212
1313
f = hyperframe.frame.DataFrame(stream_id=5)
1414
f.data = b'some binary data'
@@ -18,8 +18,8 @@ Working with it is easy:
1818
1919
data = f.serialize()
2020
21-
new_frame = hyperframe.frame.Frame.parse_frame_header(data[:9])
22-
new_frame.parse_body(data[9:])
21+
new_frame, length = hyperframe.frame.Frame.parse_frame_header(data[:9])
22+
new_frame.parse_body(memoryview(data[9:9 + length]))
2323
2424
hyperframe is pure-Python, contains no external dependencies, and runs on a
2525
wide variety of Python interpreters and platforms. Made available under the MIT

0 commit comments

Comments
 (0)