Staging
v0.5.1
https://github.com/python/cpython
Revision 01ab9634601fc1a4f9ac5d72ddc022239d2543fe authored by Miss Islington (bot) on 18 July 2020, 21:39:02 UTC, committed by GitHub on 18 July 2020, 21:39:02 UTC

Walk down the MRO backwards to find the type that originally defined the final `tp_setattro`, then make sure we are not jumping over intermediate C-level bases with the Python-level call.

Automerge-Triggered-By: @gvanrossum
(cherry picked from commit c53b310e5926266ce267c44a168165cacd786d6e)

Co-authored-by: scoder <stefan_ml@behnel.de>
1 parent 27b8110
Raw File
Tip revision: 01ab9634601fc1a4f9ac5d72ddc022239d2543fe authored by Miss Islington (bot) on 18 July 2020, 21:39:02 UTC
bpo-41295: Reimplement the Carlo Verre "hackcheck" (GH-21528)
Tip revision: 01ab963
dynload_dl.c

/* Support for dynamic loading of extension modules */

#include "dl.h"

#include "Python.h"
#include "importdl.h"


extern char *Py_GetProgramName(void);

const char *_PyImport_DynLoadFiletab[] = {".o", NULL};


dl_funcptr _PyImport_FindSharedFuncptr(const char *prefix,
                                       const char *shortname,
                                       const char *pathname, FILE *fp)
{
    char funcname[258];

    PyOS_snprintf(funcname, sizeof(funcname), "%.20s_%.200s", prefix, shortname);
    return dl_loadmod(Py_GetProgramName(), pathname, funcname);
}
back to top