diff options
author | Benjamin Peterson <benjamin@python.org> | 2012-03-17 01:15:54 (GMT) |
---|---|---|
committer | Benjamin Peterson <benjamin@python.org> | 2012-03-17 01:15:54 (GMT) |
commit | 9a03ecfa50edd1f75bfffbe1d8849d629b8f5b43 (patch) | |
tree | 34479e99e32cfed3fa92842eb0606e2568cb4542 /Objects | |
parent | 4f5139ba20a76c0bc9b3dd361cdde27b5abff6a4 (diff) | |
download | cpython-9a03ecfa50edd1f75bfffbe1d8849d629b8f5b43.zip cpython-9a03ecfa50edd1f75bfffbe1d8849d629b8f5b43.tar.gz cpython-9a03ecfa50edd1f75bfffbe1d8849d629b8f5b43.tar.bz2 |
simply this slightly
Diffstat (limited to 'Objects')
-rw-r--r-- | Objects/typeobject.c | 15 |
1 files changed, 6 insertions, 9 deletions
diff --git a/Objects/typeobject.c b/Objects/typeobject.c index db0b042..b427040 100644 --- a/Objects/typeobject.c +++ b/Objects/typeobject.c @@ -2949,13 +2949,13 @@ object_new(PyTypeObject *type, PyObject *args, PyObject *kwds) return NULL; if (type->tp_flags & Py_TPFLAGS_IS_ABSTRACT) { - static PyObject *comma = NULL; PyObject *abstract_methods = NULL; PyObject *builtins; PyObject *sorted; PyObject *sorted_methods = NULL; PyObject *joined = NULL; - _Py_IDENTIFIER(join); + PyObject *comma; + _Py_static_string(comma_id, ", "); /* Compute ", ".join(sorted(type.__abstractmethods__)) into joined. */ @@ -2973,13 +2973,10 @@ object_new(PyTypeObject *type, PyObject *args, PyObject *kwds) NULL); if (sorted_methods == NULL) goto error; - if (comma == NULL) { - comma = PyUnicode_InternFromString(", "); - if (comma == NULL) - goto error; - } - joined = _PyObject_CallMethodId(comma, &PyId_join, - "O", sorted_methods); + comma = _PyUnicode_FromId(&comma_id); + if (comma == NULL) + goto error; + joined = PyUnicode_Join(comma, sorted_methods); if (joined == NULL) goto error; |