Commit 89a68b86 authored by Stefan Behnel's avatar Stefan Behnel

Merge branch '0.29.x'

parents 1ebff687 caa52f6f
...@@ -453,6 +453,16 @@ Other changes ...@@ -453,6 +453,16 @@ Other changes
* Support for Python 2.6 was removed. * Support for Python 2.6 was removed.
0.29.21 (2020-0?-??)
====================
Bugs fixed
----------
* The deprecated C-API function ``PyUnicode_FromUnicode()`` is no longer usd.
Original patch by Inada Naoki. (Github issue #3677)
0.29.20 (2020-06-10) 0.29.20 (2020-06-10)
==================== ====================
......
...@@ -495,6 +495,7 @@ static CYTHON_INLINE PyObject* __Pyx_decode_c_string( ...@@ -495,6 +495,7 @@ static CYTHON_INLINE PyObject* __Pyx_decode_c_string(
/////////////// decode_c_string /////////////// /////////////// decode_c_string ///////////////
//@requires: IncludeStringH //@requires: IncludeStringH
//@requires: decode_c_string_utf16 //@requires: decode_c_string_utf16
//@substitute: naming
/* duplicate code to avoid calling strlen() if start >= 0 and stop >= 0 */ /* duplicate code to avoid calling strlen() if start >= 0 and stop >= 0 */
static CYTHON_INLINE PyObject* __Pyx_decode_c_string( static CYTHON_INLINE PyObject* __Pyx_decode_c_string(
...@@ -519,7 +520,7 @@ static CYTHON_INLINE PyObject* __Pyx_decode_c_string( ...@@ -519,7 +520,7 @@ static CYTHON_INLINE PyObject* __Pyx_decode_c_string(
stop += length; stop += length;
} }
if (unlikely(stop <= start)) if (unlikely(stop <= start))
return PyUnicode_FromUnicode(NULL, 0); return __Pyx_NewRef($empty_unicode);
length = stop - start; length = stop - start;
cstring += start; cstring += start;
if (decode_func) { if (decode_func) {
...@@ -538,6 +539,7 @@ static CYTHON_INLINE PyObject* __Pyx_decode_c_bytes( ...@@ -538,6 +539,7 @@ static CYTHON_INLINE PyObject* __Pyx_decode_c_bytes(
/////////////// decode_c_bytes /////////////// /////////////// decode_c_bytes ///////////////
//@requires: decode_c_string_utf16 //@requires: decode_c_string_utf16
//@substitute: naming
static CYTHON_INLINE PyObject* __Pyx_decode_c_bytes( static CYTHON_INLINE PyObject* __Pyx_decode_c_bytes(
const char* cstring, Py_ssize_t length, Py_ssize_t start, Py_ssize_t stop, const char* cstring, Py_ssize_t length, Py_ssize_t start, Py_ssize_t stop,
...@@ -555,7 +557,7 @@ static CYTHON_INLINE PyObject* __Pyx_decode_c_bytes( ...@@ -555,7 +557,7 @@ static CYTHON_INLINE PyObject* __Pyx_decode_c_bytes(
if (stop > length) if (stop > length)
stop = length; stop = length;
if (unlikely(stop <= start)) if (unlikely(stop <= start))
return PyUnicode_FromUnicode(NULL, 0); return __Pyx_NewRef($empty_unicode);
length = stop - start; length = stop - start;
cstring += start; cstring += start;
if (decode_func) { if (decode_func) {
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment