Skip to content

Commit a74bea7

Browse files
authored
chore: upgrade cython to latest version (#137)
1 parent a2f5927 commit a74bea7

File tree

2 files changed

+11
-9
lines changed

2 files changed

+11
-9
lines changed

libmc/_client.pyx

Lines changed: 10 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -8,14 +8,15 @@ from libcpp.string cimport string
88
from libcpp.vector cimport vector
99
from cpython.mem cimport PyMem_Malloc, PyMem_Free
1010
from cpython.version cimport PY_MAJOR_VERSION
11-
from cpython cimport Py_INCREF, Py_DECREF, PyInt_AsLong, PyInt_FromLong
12-
13-
if PY_MAJOR_VERSION < 3:
14-
from cpython cimport PyString_AsStringAndSize, PyString_AsString
15-
import cPickle as pickle
16-
else:
17-
from cpython cimport PyBytes_AsStringAndSize as PyString_AsStringAndSize, PyBytes_AsString as PyString_AsString, PyUnicode_AsUTF8String
18-
import pickle
11+
from cpython cimport (
12+
Py_INCREF, Py_DECREF,
13+
PyLong_AsLong as PyInt_AsLong,
14+
PyLong_FromLong as PyInt_FromLong,
15+
PyBytes_AsStringAndSize as PyString_AsStringAndSize,
16+
PyBytes_AsString as PyString_AsString,
17+
PyUnicode_AsUTF8String,
18+
)
19+
from ctypes import c_long as long
1920

2021
import os
2122
import sys
@@ -24,6 +25,7 @@ import threading
2425
import zlib
2526
import marshal
2627
import warnings
28+
import pickle
2729
from contextlib import contextmanager
2830

2931
cdef extern from "Common.h" namespace "douban::mc":

setup.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -100,7 +100,7 @@ def find_version(*file_paths):
100100
"Topic :: Software Development :: Libraries",
101101
],
102102
# Support for the basestring type is new in Cython 0.20.
103-
setup_requires=["Cython >= 0.20, < 3.1"],
103+
setup_requires=["Cython >= 0.20"],
104104
ext_modules=[
105105
Extension(
106106
"libmc._client",

0 commit comments

Comments
 (0)