• Christian Tismer's avatar
    bpo-33738: Fix macros which contradict PEP 384 (GH-7477) · ea62ce7f
    Christian Tismer yazdı
    During development of the limited API support for PySide,
    we saw an error in a macro that accessed a type field.
    
    This patch fixes the 7 errors in the Python headers.
    Macros which were not written as capitals were implemented
    as function.
    
    To do the necessary analysis again, a script was included that
    parses all headers and looks for "->tp_" in serctions which can
    be reached with active limited API.
    
    It is easily possible to call this script as a test.
    
    Error listing:
    
    ../../Include/objimpl.h:243
    #define PyObject_IS_GC(o) (PyType_IS_GC(Py_TYPE(o)) && \
        (Py_TYPE(o)->tp_is_gc == NULL || Py_TYPE(o)->tp_is_gc(o)))
    Action: commented only
    
    ../../Include/objimpl.h:362
    #define PyType_SUPPORTS_WEAKREFS(t) ((t)->tp_weaklistoffset > 0)
    Action: commented only
    
    ../../Include/objimpl.h:364
    #define PyObject_GET_WEAKREFS_LISTPTR(o) \
        ((PyObject **) (((char *) (o)) + Py_TYPE(o)->tp_weaklistoffset))
    Action: commented only
    
    ../../Include/pyerrors.h:143
    #define PyExceptionClass_Name(x) \
         ((char *)(((PyTypeObject*)(x))->tp_name))
    Action: implemented function
    
    ../../Include/abstract.h:593
    #define PyIter_Check(obj) \
        ((obj)->ob_type->tp_iternext != NULL && \
         (obj)->ob_type->tp_iternext != &_PyObject_NextNotImplemented)
    Action: implemented function
    
    ../../Include/abstract.h:713
    #define PyIndex_Check(obj)                              \
        ((obj)->ob_type->tp_as_number != NULL &&            \
         (obj)->ob_type->tp_as_number->nb_index != NULL)
    Action: implemented function
    
    ../../Include/abstract.h:924
    #define PySequence_ITEM(o, i)\
        ( Py_TYPE(o)->tp_as_sequence->sq_item(o, i) )
    Action: commented only
    ea62ce7f
Adı
Son kayıt (commit)
Son güncelleme
..
2017-10-02-21-02-14.bpo-21983.UoC319.rst Loading commit data...
2017-11-26-00-59-22.bpo-10544.fHOM3V.rst Loading commit data...
2017-12-24-19-48-59.bpo-17611.P85kWL.rst Loading commit data...
2018-01-03-23-12-43.bpo-32489.SDEPHB.rst Loading commit data...
2018-01-26-21-20-21.bpo-32583.Fh3fau.rst Loading commit data...
2018-01-29-14-36-37.bpo-32711.8hQFJP.rst Loading commit data...
2018-02-01-10-16-28.bpo-32303.VsvhSl.rst Loading commit data...
2018-02-01-10-56-41.bpo-32305.dkU9Qa.rst Loading commit data...
2018-02-02-08-50-46.bpo-31356.MNwUOQ.rst Loading commit data...
2018-02-14-12-35-47.bpo-32836.bThJnx.rst Loading commit data...
2018-02-20-21-53-48.bpo-32889.J6eWy5.rst Loading commit data...
2018-02-24-00-07-05.bpo-32925.e-7Ufh.rst Loading commit data...
2018-02-24-21-51-42.bpo-32932.2cz31L.rst Loading commit data...
2018-02-25-10-52-40.bpo-32946.Lo09rG.rst Loading commit data...
2018-02-27-13-36-21.bpo-17288.Gdj24S.rst Loading commit data...
2018-02-27-20-57-00.bpo-32911.cmKfco.rst Loading commit data...
2018-03-06-12-19-19.bpo-33005.LP-V2U.rst Loading commit data...
2018-03-08-09-48-38.bpo-33026.QZA3Ba.rst Loading commit data...
2018-03-10-15-16-40.bpo-33041.-ak5Fk.rst Loading commit data...
2018-03-18-13-56-14.bpo-33041.XwPhI2.rst Loading commit data...
2018-03-22-23-09-06.bpo-33018.0ncEJV.rst Loading commit data...
2018-03-25-19-49-06.bpo-33053.V3xlsH.rst Loading commit data...
2018-04-02-09-32-40.bpo-33199.TPnxQu.rst Loading commit data...
2018-04-03-00-30-25.bpo-29922.CdLuMl.rst Loading commit data...
2018-04-03-00-58-41.bpo-33205.lk2F3r.rst Loading commit data...
2018-04-05-22-20-44.bpo-33231.3Jmo0q.rst Loading commit data...
2018-04-13-22-31-09.bpo-33176.PB9com.rst Loading commit data...
2018-04-14-13-12-50.bpo-33270.UmVV6i.rst Loading commit data...
2018-04-19-08-30-07.bpo-33312.mDe2iL.rst Loading commit data...
2018-04-24-22-31-04.bpo-33128.g2yLuf.rst Loading commit data...
2018-04-25-20-44-42.bpo-28055.f49kfC.rst Loading commit data...
2018-04-26-22-48-28.bpo-33363.8RCnN2.rst Loading commit data...
2018-05-02-08-36-03.bpo-33391.z4a7rb.rst Loading commit data...
2018-05-13-01-26-18.bpo-33475.rI0y1U.rst Loading commit data...
2018-05-14-11-00-00.bpo-31849.EmHaH4.rst Loading commit data...
2018-05-14-17-31-02.bpo-33509.pIUfTd.rst Loading commit data...
2018-05-17-13-06-36.bpo-23722.xisqZk.rst Loading commit data...
2018-05-23-20-46-14.bpo-33622.xPucO9.rst Loading commit data...
2018-05-28-12-28-53.bpo-30654.9fDJye.rst Loading commit data...
2018-05-31-14-50-04.bpo-33706.ztlH04.rst Loading commit data...
2018-06-06-23-24-40.bpo-33786.lBvT8z.rst Loading commit data...
2018-06-07-18-34-19.bpo-33738.ODZS7a.rst Loading commit data...
2018-06-07-20-18-38.bpo-33803.n-Nq6_.rst Loading commit data...
README.rst Loading commit data...