mirror of
https://github.com/python/cpython.git
synced 2025-11-25 04:34:37 +00:00
PEP 3123: Provide forward compatibility with Python 3.0, while keeping
backwards compatibility. Add Py_Refcnt, Py_Type, Py_Size, and PyVarObject_HEAD_INIT.
This commit is contained in:
parent
b1994b4a5d
commit
6819210b9e
129 changed files with 1090 additions and 1250 deletions
|
|
@ -120,7 +120,7 @@ typedef struct {
|
|||
staticforward PyTypeObject PyProfiler_Type;
|
||||
|
||||
#define PyProfiler_Check(op) PyObject_TypeCheck(op, &PyProfiler_Type)
|
||||
#define PyProfiler_CheckExact(op) ((op)->ob_type == &PyProfiler_Type)
|
||||
#define PyProfiler_CheckExact(op) (Py_Type(op) == &PyProfiler_Type)
|
||||
|
||||
/*** External Timers ***/
|
||||
|
||||
|
|
@ -207,7 +207,7 @@ normalizeUserObj(PyObject *obj)
|
|||
PyObject *self = fn->m_self;
|
||||
PyObject *name = PyString_FromString(fn->m_ml->ml_name);
|
||||
if (name != NULL) {
|
||||
PyObject *mo = _PyType_Lookup(self->ob_type, name);
|
||||
PyObject *mo = _PyType_Lookup(Py_Type(self), name);
|
||||
Py_XINCREF(mo);
|
||||
Py_DECREF(name);
|
||||
if (mo != NULL) {
|
||||
|
|
@ -744,7 +744,7 @@ profiler_dealloc(ProfilerObject *op)
|
|||
flush_unmatched(op);
|
||||
clearEntries(op);
|
||||
Py_XDECREF(op->externalTimer);
|
||||
op->ob_type->tp_free(op);
|
||||
Py_Type(op)->tp_free(op);
|
||||
}
|
||||
|
||||
static int
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue