Kaydet (Commit) d3a5f53a authored tarafından Martin v. Löwis's avatar Martin v. Löwis

Avoid reinitializing the types twice.

üst 8d0701da
......@@ -446,6 +446,7 @@ static PyObject* ast2obj_bool(bool b)
self.emit("static int init_types(void)",0)
self.emit("{", 0)
self.emit("if (initialized) return 1;", 1)
self.emit("initialized = 1;", 1)
for dfn in mod.dfns:
self.visit(dfn)
self.emit("return 1;", 0);
......
......@@ -392,6 +392,7 @@ static int initialized;
static int init_types(void)
{
if (initialized) return 1;
initialized = 1;
mod_type = make_type("mod", &PyBaseObject_Type, NULL, 0);
Module_type = make_type("Module", mod_type, Module_fields, 1);
Interactive_type = make_type("Interactive", mod_type,
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment