From: Martin v. Löwis Date: Mon, 27 Feb 2006 00:09:50 +0000 (+0000) Subject: Avoid reinitializing the types twice. X-Git-Tag: v2.5a0~534 X-Git-Url: https://granicus.if.org/sourcecode?a=commitdiff_plain;h=d3a5f53a27be821cfdff869fd8ad93a060497e8c;p=python Avoid reinitializing the types twice. --- diff --git a/Parser/asdl_c.py b/Parser/asdl_c.py index a853f5e573..e1dd4632bc 100755 --- a/Parser/asdl_c.py +++ b/Parser/asdl_c.py @@ -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); diff --git a/Python/Python-ast.c b/Python/Python-ast.c index cf27129183..6935851df3 100644 --- a/Python/Python-ast.c +++ b/Python/Python-ast.c @@ -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,