diff options
author | Martin v. Löwis <martin@v.loewis.de> | 2011-10-14 13:16:45 (GMT) |
---|---|---|
committer | Martin v. Löwis <martin@v.loewis.de> | 2011-10-14 13:16:45 (GMT) |
commit | 1c67dd9b154d57baf58ed081767e199af1e84923 (patch) | |
tree | 0d6c95e99785f9b8381c808a5cb433adf319eda5 /Modules/itertoolsmodule.c | |
parent | bd928fef428e48084ff29ece0e21d07ad86d0793 (diff) | |
download | cpython-1c67dd9b154d57baf58ed081767e199af1e84923.zip cpython-1c67dd9b154d57baf58ed081767e199af1e84923.tar.gz cpython-1c67dd9b154d57baf58ed081767e199af1e84923.tar.bz2 |
Port SetAttrString/HasAttrString to SetAttrId/GetAttrId.
Diffstat (limited to 'Modules/itertoolsmodule.c')
-rw-r--r-- | Modules/itertoolsmodule.c | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/Modules/itertoolsmodule.c b/Modules/itertoolsmodule.c index 63f199b..15b0c17 100644 --- a/Modules/itertoolsmodule.c +++ b/Modules/itertoolsmodule.c @@ -626,6 +626,7 @@ tee(PyObject *self, PyObject *args) { Py_ssize_t i, n=2; PyObject *it, *iterable, *copyable, *result; + _Py_IDENTIFIER(__copy__); if (!PyArg_ParseTuple(args, "O|n", &iterable, &n)) return NULL; @@ -643,7 +644,7 @@ tee(PyObject *self, PyObject *args) Py_DECREF(result); return NULL; } - if (!PyObject_HasAttrString(it, "__copy__")) { + if (!_PyObject_HasAttrId(it, &PyId___copy__)) { copyable = tee_fromiterable(it); Py_DECREF(it); if (copyable == NULL) { @@ -654,7 +655,6 @@ tee(PyObject *self, PyObject *args) copyable = it; PyTuple_SET_ITEM(result, 0, copyable); for (i=1 ; i<n ; i++) { - _Py_IDENTIFIER(__copy__); copyable = _PyObject_CallMethodId(copyable, &PyId___copy__, NULL); if (copyable == NULL) { |