Skip to content

Commit 7847277

Browse files
committed
deploy: 3c500c0
1 parent 7283899 commit 7847277

2 files changed

Lines changed: 10 additions & 10 deletions

File tree

protocol/index.html

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -834,8 +834,8 @@ <h1 id="errors">Errors</h1>
834834
return struct.pack(&#34;!i&#34;, len(encoded)) + encoded
835835

836836
@staticmethod
837-
def pack_block(block: bytes) -&gt; bytes:
838-
return struct.pack(&#34;!I&#34;, len(block)) + block
837+
def pack_block(block: bytes | bytearray) -&gt; bytes:
838+
return struct.pack(&#34;!I&#34;, len(block)) + bytes(block)
839839

840840
@staticmethod
841841
def read_block(data):
@@ -940,16 +940,16 @@ <h3>Static methods</h3>
940940
<div class="desc"><p>Encodes a python object as a block of QStrings</p></div>
941941
</dd>
942942
<dt id="server.protocol.QDataStreamProtocol.pack_block"><code class="name flex">
943-
<span>def <span class="ident">pack_block</span></span>(<span>block: bytes) ‑> bytes</span>
943+
<span>def <span class="ident">pack_block</span></span>(<span>block: bytes | bytearray) ‑> bytes</span>
944944
</code></dt>
945945
<dd>
946946
<details class="source">
947947
<summary>
948948
<span>Expand source code</span>
949949
</summary>
950950
<pre><code class="python">@staticmethod
951-
def pack_block(block: bytes) -&gt; bytes:
952-
return struct.pack(&#34;!I&#34;, len(block)) + block</code></pre>
951+
def pack_block(block: bytes | bytearray) -&gt; bytes:
952+
return struct.pack(&#34;!I&#34;, len(block)) + bytes(block)</code></pre>
953953
</details>
954954
<div class="desc"></div>
955955
</dd>

protocol/qdatastream.html

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -110,8 +110,8 @@ <h2 class="section-title" id="header-classes">Classes</h2>
110110
return struct.pack(&#34;!i&#34;, len(encoded)) + encoded
111111

112112
@staticmethod
113-
def pack_block(block: bytes) -&gt; bytes:
114-
return struct.pack(&#34;!I&#34;, len(block)) + block
113+
def pack_block(block: bytes | bytearray) -&gt; bytes:
114+
return struct.pack(&#34;!I&#34;, len(block)) + bytes(block)
115115

116116
@staticmethod
117117
def read_block(data):
@@ -216,16 +216,16 @@ <h3>Static methods</h3>
216216
<div class="desc"><p>Encodes a python object as a block of QStrings</p></div>
217217
</dd>
218218
<dt id="server.protocol.qdatastream.QDataStreamProtocol.pack_block"><code class="name flex">
219-
<span>def <span class="ident">pack_block</span></span>(<span>block: bytes) ‑> bytes</span>
219+
<span>def <span class="ident">pack_block</span></span>(<span>block: bytes | bytearray) ‑> bytes</span>
220220
</code></dt>
221221
<dd>
222222
<details class="source">
223223
<summary>
224224
<span>Expand source code</span>
225225
</summary>
226226
<pre><code class="python">@staticmethod
227-
def pack_block(block: bytes) -&gt; bytes:
228-
return struct.pack(&#34;!I&#34;, len(block)) + block</code></pre>
227+
def pack_block(block: bytes | bytearray) -&gt; bytes:
228+
return struct.pack(&#34;!I&#34;, len(block)) + bytes(block)</code></pre>
229229
</details>
230230
<div class="desc"></div>
231231
</dd>

0 commit comments

Comments
 (0)