diff options
author | Vinay Sajip <vinay_sajip@yahoo.co.uk> | 2017-01-27 12:43:41 +0000 |
---|---|---|
committer | Vinay Sajip <vinay_sajip@yahoo.co.uk> | 2017-01-27 12:43:41 +0000 |
commit | bbbab3c96168cea9f872f90da0a385b50f62ca70 (patch) | |
tree | dd00609da6492fbc378e8eef70c8cf162ce1e8b0 /Objects/stringlib/unicode_format.h | |
parent | 49851a445bdbd7783f031fbb3e6972b55b885316 (diff) | |
parent | a10bdbd9f7b296da8a546ad430763b2f07dd32b9 (diff) | |
download | cpython-bbbab3c96168cea9f872f90da0a385b50f62ca70.tar.gz |
Closes #29308: Merged fix from 3.6.
Diffstat (limited to 'Objects/stringlib/unicode_format.h')
-rw-r--r-- | Objects/stringlib/unicode_format.h | 6 |
1 files changed, 2 insertions, 4 deletions
diff --git a/Objects/stringlib/unicode_format.h b/Objects/stringlib/unicode_format.h index 14fa28ea54..7ac0d75166 100644 --- a/Objects/stringlib/unicode_format.h +++ b/Objects/stringlib/unicode_format.h @@ -60,10 +60,8 @@ SubString_init(SubString *str, PyObject *s, Py_ssize_t start, Py_ssize_t end) Py_LOCAL_INLINE(PyObject *) SubString_new_object(SubString *str) { - if (str->str == NULL) { - Py_INCREF(Py_None); - return Py_None; - } + if (str->str == NULL) + Py_RETURN_NONE; return PyUnicode_Substring(str->str, str->start, str->end); } |