Skip to content

Commit 701284a

Browse files
Copilotwhtsky
andcommitted
Fix Cython 3 compilation: remove Python 2 long type from encode_func
In Python 3, `long` doesn't exist (unified with `int`). Cython 3 rejects `long` as a Python type identifier. Remove the `long: encode_long` entry and route `int` to the untyped `encode_long` handler so arbitrary-size Python integers are supported. Co-authored-by: whtsky <876694+whtsky@users.noreply.github.com>
1 parent b4b4344 commit 701284a

1 file changed

Lines changed: 2 additions & 3 deletions

File tree

bencoder.pyx

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -147,9 +147,8 @@ cdef encode_dict(x, list r):
147147

148148

149149
encode_func = {
150-
int: encode_int,
151-
bool: encode_int,
152-
long: encode_long,
150+
int: encode_long,
151+
bool: encode_int,
153152
bytes: encode_bytes,
154153
str: encode_string,
155154
list: encode_list,

0 commit comments

Comments
 (0)