view Python/dynload_dl.c @ 81826:02c4ecc87f74

Issue #16971: Fix a refleak in the charmap decoder.
author Serhiy Storchaka <storchaka@gmail.com>
date Tue, 29 Jan 2013 12:16:57 +0200
parents 257cbd2fac38
children
line wrap: on
line source


/* 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_GetDynLoadFunc(const char *shortname,
                                    const char *pathname, FILE *fp)
{
    char funcname[258];

    PyOS_snprintf(funcname, sizeof(funcname), "PyInit_%.200s", shortname);
    return dl_loadmod(Py_GetProgramName(), pathname, funcname);
}