示例#1
0
void
initimport()
{
	if (import_modules != NULL)
		fatal("duplicate initimport() call");
	if ((import_modules = newdictobject()) == NULL)
		fatal("no mem for dictionary of modules");
}
示例#2
0
object *newmoduleobject(char *name)
{
    moduleobject *m = NEWOBJ(moduleobject, &Moduletype);
    if (m == NULL)
        return NULL;
    m->md_name = newstringobject(name);
    m->md_dict = newdictobject();
    if (m->md_name == NULL || m->md_dict == NULL) {
        DECREF(m);
        return NULL;
    }
    return (object *)m;
}
示例#3
0
void
initimport()
{
	if ((modules = newdictobject()) == NULL)
		fatal("no mem for dictionary of modules");
}