diff options
author | Stefan Behnel <stefan_ml@behnel.de> | 2023-05-15 20:52:34 +0200 |
---|---|---|
committer | Stefan Behnel <stefan_ml@behnel.de> | 2023-05-15 20:52:34 +0200 |
commit | 580ceee71fd890b86678ec3c41b6a2b73b18440f (patch) | |
tree | 1504bb2ed9d9a2ae81007d1939129915e406a34e | |
parent | cd882212a6ddfc90b6760be44b95e2389dde4949 (diff) | |
parent | f797c86c31f4bceabb386278f0d1686cb218da9b (diff) | |
download | cython-580ceee71fd890b86678ec3c41b6a2b73b18440f.tar.gz |
Merge branch 'master' of git+ssh://github.com/cython/cython
-rw-r--r-- | Cython/Utility/CppConvert.pyx | 5 |
1 files changed, 3 insertions, 2 deletions
diff --git a/Cython/Utility/CppConvert.pyx b/Cython/Utility/CppConvert.pyx index 35f4c50ef..1c6239b2b 100644 --- a/Cython/Utility/CppConvert.pyx +++ b/Cython/Utility/CppConvert.pyx @@ -66,13 +66,14 @@ cdef extern from "Python.h": cdef object {{cname}}(const vector[X]& v): if v.size() > <size_t> PY_SSIZE_T_MAX: raise MemoryError() + v_size_signed = <Py_ssize_t> v.size() - o = PyList_New(<Py_ssize_t> v.size()) + o = PyList_New(v_size_signed) cdef Py_ssize_t i cdef object item - for i in range(v.size()): + for i in range(v_size_signed): item = v[i] Py_INCREF(item) PyList_SET_ITEM(o, i, item) |