mirror of
https://github.com/python/cpython.git
synced 2025-09-26 18:29:57 +00:00
simply this slightly
This commit is contained in:
parent
4f5139ba20
commit
9a03ecfa50
1 changed files with 6 additions and 9 deletions
|
@ -2949,13 +2949,13 @@ object_new(PyTypeObject *type, PyObject *args, PyObject *kwds)
|
||||||
return NULL;
|
return NULL;
|
||||||
|
|
||||||
if (type->tp_flags & Py_TPFLAGS_IS_ABSTRACT) {
|
if (type->tp_flags & Py_TPFLAGS_IS_ABSTRACT) {
|
||||||
static PyObject *comma = NULL;
|
|
||||||
PyObject *abstract_methods = NULL;
|
PyObject *abstract_methods = NULL;
|
||||||
PyObject *builtins;
|
PyObject *builtins;
|
||||||
PyObject *sorted;
|
PyObject *sorted;
|
||||||
PyObject *sorted_methods = NULL;
|
PyObject *sorted_methods = NULL;
|
||||||
PyObject *joined = NULL;
|
PyObject *joined = NULL;
|
||||||
_Py_IDENTIFIER(join);
|
PyObject *comma;
|
||||||
|
_Py_static_string(comma_id, ", ");
|
||||||
|
|
||||||
/* Compute ", ".join(sorted(type.__abstractmethods__))
|
/* Compute ", ".join(sorted(type.__abstractmethods__))
|
||||||
into joined. */
|
into joined. */
|
||||||
|
@ -2973,13 +2973,10 @@ object_new(PyTypeObject *type, PyObject *args, PyObject *kwds)
|
||||||
NULL);
|
NULL);
|
||||||
if (sorted_methods == NULL)
|
if (sorted_methods == NULL)
|
||||||
goto error;
|
goto error;
|
||||||
if (comma == NULL) {
|
comma = _PyUnicode_FromId(&comma_id);
|
||||||
comma = PyUnicode_InternFromString(", ");
|
|
||||||
if (comma == NULL)
|
if (comma == NULL)
|
||||||
goto error;
|
goto error;
|
||||||
}
|
joined = PyUnicode_Join(comma, sorted_methods);
|
||||||
joined = _PyObject_CallMethodId(comma, &PyId_join,
|
|
||||||
"O", sorted_methods);
|
|
||||||
if (joined == NULL)
|
if (joined == NULL)
|
||||||
goto error;
|
goto error;
|
||||||
|
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue