Staging
v0.5.1
https://github.com/python/cpython
Revision ef582abab461e306ac3fa0ad867b2db564fed3a5 authored by Guido van Rossum on 10 April 2003, 20:30:18 UTC, committed by Guido van Rossum on 10 April 2003, 20:30:18 UTC
PyErr_NormalizeException(): in the type==NULL test, we should simply
return.  Setting an exception can mess with the exception state, and
continuing is definitely wrong (since type is dereferenced later on).
Some code that calls this seems to be prepared for a NULL exception
type, so let's be safe rather than sorry and simply assume there's
nothing to normalize in this case.
1 parent d065a13
Raw File
Tip revision: ef582abab461e306ac3fa0ad867b2db564fed3a5 authored by Guido van Rossum on 10 April 2003, 20:30:18 UTC
Backport:
Tip revision: ef582ab
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 struct filedescr _PyImport_DynLoadFiletab[] = {
	{".o", "rb", C_EXTENSION},
	{"module.o", "rb", C_EXTENSION},
	{0, 0}
};


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

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