summaryrefslogtreecommitdiffstats
path: root/Modules/_hotshot.c
diff options
context:
space:
mode:
authorRaymond Hettinger <python@rcn.com>2003-03-17 08:35:49 (GMT)
committerRaymond Hettinger <python@rcn.com>2003-03-17 08:35:49 (GMT)
commite0cce8f8f00bf2c070cb1f564d950d62530df377 (patch)
tree32e33182bb5b59df8f581878cf1b61aa4756aea2 /Modules/_hotshot.c
parent01538269643175877f516d09f429a2ae28136da6 (diff)
downloadcpython-e0cce8f8f00bf2c070cb1f564d950d62530df377.zip
cpython-e0cce8f8f00bf2c070cb1f564d950d62530df377.tar.gz
cpython-e0cce8f8f00bf2c070cb1f564d950d62530df377.tar.bz2
Created PyObject_GenericGetIter().
Factors out the common case of returning self.
Diffstat (limited to 'Modules/_hotshot.c')
-rw-r--r--Modules/_hotshot.c9
1 files changed, 1 insertions, 8 deletions
diff --git a/Modules/_hotshot.c b/Modules/_hotshot.c
index 83222ce..8b286b4 100644
--- a/Modules/_hotshot.c
+++ b/Modules/_hotshot.c
@@ -141,13 +141,6 @@ logreader_fileno(LogReaderObject *self)
return PyInt_FromLong(fileno(self->logfp));
}
-static PyObject *
-logreader_tp_iter(LogReaderObject *self)
-{
- Py_INCREF(self);
- return (PyObject *) self;
-}
-
/* Log File Format
* ---------------
@@ -1352,7 +1345,7 @@ static PyTypeObject LogReaderType = {
0, /* tp_clear */
0, /* tp_richcompare */
0, /* tp_weaklistoffset */
- (getiterfunc)logreader_tp_iter, /* tp_iter */
+ PyObject_GenericGetIter, /* tp_iter */
(iternextfunc)logreader_tp_iternext,/* tp_iternext */
logreader_methods, /* tp_methods */
logreader_members, /* tp_members */