mirror of
https://github.com/python/cpython.git
synced 2025-12-08 06:10:17 +00:00
Co-authored-by: Dave Peck <davepeck@gmail.com> Co-authored-by: sobolevn <mail@sobolevn.me>
This commit is contained in:
parent
0d87bb66d3
commit
af8d1f56f5
13 changed files with 2098 additions and 2134 deletions
|
|
@ -56,7 +56,6 @@ OF OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
|
|||
#include "pycore_pyhash.h" // _Py_HashSecret_t
|
||||
#include "pycore_pylifecycle.h" // _Py_SetFileSystemEncoding()
|
||||
#include "pycore_pystate.h" // _PyInterpreterState_GET()
|
||||
#include "pycore_template.h" // _PyTemplate_Concat()
|
||||
#include "pycore_tuple.h" // _PyTuple_FromArray()
|
||||
#include "pycore_ucnhash.h" // _PyUnicode_Name_CAPI
|
||||
#include "pycore_unicodeobject.h" // struct _Py_unicode_state
|
||||
|
|
@ -11639,16 +11638,10 @@ PyUnicode_Concat(PyObject *left, PyObject *right)
|
|||
return NULL;
|
||||
|
||||
if (!PyUnicode_Check(right)) {
|
||||
if (_PyTemplate_CheckExact(right)) {
|
||||
// str + tstring is implemented in the tstring type
|
||||
return _PyTemplate_Concat(left, right);
|
||||
}
|
||||
else {
|
||||
PyErr_Format(PyExc_TypeError,
|
||||
"can only concatenate str (not \"%.200s\") to str",
|
||||
Py_TYPE(right)->tp_name);
|
||||
return NULL;
|
||||
}
|
||||
PyErr_Format(PyExc_TypeError,
|
||||
"can only concatenate str (not \"%.200s\") to str",
|
||||
Py_TYPE(right)->tp_name);
|
||||
return NULL;
|
||||
}
|
||||
|
||||
/* Shortcuts */
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue