summaryrefslogtreecommitdiffstats
path: root/Modules/_hotshot.c
diff options
context:
space:
mode:
authorMartin v. Löwis <martin@v.loewis.de>2007-07-21 06:55:02 (GMT)
committerMartin v. Löwis <martin@v.loewis.de>2007-07-21 06:55:02 (GMT)
commit6819210b9e4e5719a6f7f9c1725f8fa70a8936f6 (patch)
tree456e2e6b3d9d71e966f3b0e419ecfe44ce3c1fdd /Modules/_hotshot.c
parentb1994b4a5d0139a010eb0af1d6615a3df92fe786 (diff)
downloadcpython-6819210b9e4e5719a6f7f9c1725f8fa70a8936f6.zip
cpython-6819210b9e4e5719a6f7f9c1725f8fa70a8936f6.tar.gz
cpython-6819210b9e4e5719a6f7f9c1725f8fa70a8936f6.tar.bz2
PEP 3123: Provide forward compatibility with Python 3.0, while keeping
backwards compatibility. Add Py_Refcnt, Py_Type, Py_Size, and PyVarObject_HEAD_INIT.
Diffstat (limited to 'Modules/_hotshot.c')
-rw-r--r--Modules/_hotshot.c10
1 files changed, 4 insertions, 6 deletions
diff --git a/Modules/_hotshot.c b/Modules/_hotshot.c
index 21bd383..4bbb3b5 100644
--- a/Modules/_hotshot.c
+++ b/Modules/_hotshot.c
@@ -1220,8 +1220,7 @@ PyDoc_STRVAR(profiler_object__doc__,
"linetimings: True if line events collect timing information.");
static PyTypeObject ProfilerType = {
- PyObject_HEAD_INIT(NULL)
- 0, /* ob_size */
+ PyVarObject_HEAD_INIT(NULL, 0)
"_hotshot.ProfilerType", /* tp_name */
(int) sizeof(ProfilerObject), /* tp_basicsize */
0, /* tp_itemsize */
@@ -1305,8 +1304,7 @@ static PyGetSetDef logreader_getsets[] = {
};
static PyTypeObject LogReaderType = {
- PyObject_HEAD_INIT(NULL)
- 0, /* ob_size */
+ PyVarObject_HEAD_INIT(NULL, 0)
"_hotshot.LogReaderType", /* tp_name */
(int) sizeof(LogReaderObject), /* tp_basicsize */
0, /* tp_itemsize */
@@ -1613,8 +1611,8 @@ init_hotshot(void)
{
PyObject *module;
- LogReaderType.ob_type = &PyType_Type;
- ProfilerType.ob_type = &PyType_Type;
+ Py_Type(&LogReaderType) = &PyType_Type;
+ Py_Type(&ProfilerType) = &PyType_Type;
module = Py_InitModule("_hotshot", functions);
if (module != NULL) {
char *s = get_version_string();