Commit efad2449 authored by Benjamin Peterson's avatar Benjamin Peterson

hardcode the old svn __version__

parent 2193d2b7
...@@ -899,9 +899,6 @@ static int add_ast_fields(void) ...@@ -899,9 +899,6 @@ static int add_ast_fields(void)
self.emit("if (!%s_singleton) return 0;" % cons.name, 1) self.emit("if (!%s_singleton) return 0;" % cons.name, 1)
def parse_version(mod):
return mod.version.value[12:-3]
class ASTModuleVisitor(PickleVisitor): class ASTModuleVisitor(PickleVisitor):
def visitModule(self, mod): def visitModule(self, mod):
...@@ -921,7 +918,7 @@ class ASTModuleVisitor(PickleVisitor): ...@@ -921,7 +918,7 @@ class ASTModuleVisitor(PickleVisitor):
self.emit("return NULL;", 2) self.emit("return NULL;", 2)
# Value of version: "$Revision$" # Value of version: "$Revision$"
self.emit('if (PyModule_AddStringConstant(m, "__version__", "%s") < 0)' self.emit('if (PyModule_AddStringConstant(m, "__version__", "%s") < 0)'
% parse_version(mod), 1) % mod.version, 1)
self.emit("return NULL;", 2) self.emit("return NULL;", 2)
for dfn in mod.dfns: for dfn in mod.dfns:
self.visit(dfn) self.visit(dfn)
...@@ -1160,6 +1157,7 @@ def main(srcfile): ...@@ -1160,6 +1157,7 @@ def main(srcfile):
argv0 = os.sep.join(components[-2:]) argv0 = os.sep.join(components[-2:])
auto_gen_msg = common_msg % argv0 auto_gen_msg = common_msg % argv0
mod = asdl.parse(srcfile) mod = asdl.parse(srcfile)
mod.version = "82163"
if not asdl.check(mod): if not asdl.check(mod):
sys.exit(1) sys.exit(1)
if INC_DIR: if INC_DIR:
...@@ -1181,7 +1179,7 @@ def main(srcfile): ...@@ -1181,7 +1179,7 @@ def main(srcfile):
p = os.path.join(SRC_DIR, str(mod.name) + "-ast.c") p = os.path.join(SRC_DIR, str(mod.name) + "-ast.c")
f = open(p, "w") f = open(p, "w")
f.write(auto_gen_msg) f.write(auto_gen_msg)
f.write(c_file_msg % parse_version(mod)) f.write(c_file_msg % mod.version)
f.write('#include "Python.h"\n') f.write('#include "Python.h"\n')
f.write('#include "%s-ast.h"\n' % mod.name) f.write('#include "%s-ast.h"\n' % mod.name)
f.write('\n') f.write('\n')
......
...@@ -2,7 +2,7 @@ ...@@ -2,7 +2,7 @@
/* /*
__version__ . __version__ 82163.
This module must be committed separately after each AST grammar change; This module must be committed separately after each AST grammar change;
The __version__ number is set to the revision number of the commit The __version__ number is set to the revision number of the commit
...@@ -6756,7 +6756,7 @@ PyInit__ast(void) ...@@ -6756,7 +6756,7 @@ PyInit__ast(void)
NULL; NULL;
if (PyModule_AddIntConstant(m, "PyCF_ONLY_AST", PyCF_ONLY_AST) < 0) if (PyModule_AddIntConstant(m, "PyCF_ONLY_AST", PyCF_ONLY_AST) < 0)
return NULL; return NULL;
if (PyModule_AddStringConstant(m, "__version__", "") < 0) if (PyModule_AddStringConstant(m, "__version__", "82163") < 0)
return NULL; return NULL;
if (PyDict_SetItemString(d, "mod", (PyObject*)mod_type) < 0) return if (PyDict_SetItemString(d, "mod", (PyObject*)mod_type) < 0) return
NULL; NULL;
......
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