diff options
author | Benjamin Peterson <benjamin@python.org> | 2011-07-16 02:10:13 (GMT) |
---|---|---|
committer | Benjamin Peterson <benjamin@python.org> | 2011-07-16 02:10:13 (GMT) |
commit | 0bd152cd67fef5c238ed15ba2ce09f6a74e8d334 (patch) | |
tree | c1db691553896d0c95fbd39055b330e6a79a6861 /Parser | |
parent | e720725c12e37a1081e2f493b67254096f6d5aa3 (diff) | |
download | cpython-0bd152cd67fef5c238ed15ba2ce09f6a74e8d334.zip cpython-0bd152cd67fef5c238ed15ba2ce09f6a74e8d334.tar.gz cpython-0bd152cd67fef5c238ed15ba2ce09f6a74e8d334.tar.bz2 |
remove ast.__version__ (closes #12273)
Diffstat (limited to 'Parser')
-rwxr-xr-x | Parser/asdl_c.py | 29 |
1 files changed, 0 insertions, 29 deletions
diff --git a/Parser/asdl_c.py b/Parser/asdl_c.py index cdce5a3..22ef3d0 100755 --- a/Parser/asdl_c.py +++ b/Parser/asdl_c.py @@ -900,10 +900,6 @@ class ASTModuleVisitor(PickleVisitor): self.emit('if (PyDict_SetItemString(d, "AST", (PyObject*)&AST_type) < 0) return NULL;', 1) self.emit('if (PyModule_AddIntConstant(m, "PyCF_ONLY_AST", PyCF_ONLY_AST) < 0)', 1) self.emit("return NULL;", 2) - # Value of version: "$Revision$" - self.emit('if (PyModule_AddStringConstant(m, "__version__", "%s") < 0)' - % (mod.version,), 1) - self.emit("return NULL;", 2) for dfn in mod.dfns: self.visit(dfn) self.emit("return m;", 1) @@ -1124,29 +1120,6 @@ class ChainOfVisitors: common_msg = "/* File automatically generated by %s. */\n\n" -c_file_msg = """ -/* - __version__ %s. - - This module must be committed separately after each AST grammar change; - The __version__ number is set to the revision number of the commit - containing the grammar change. -*/ - -""" - - -def get_file_revision(f): - """Fish out the last change to a file in hg.""" - args = ["hg", "log", "--template", "{node|short}", "--limit", "1", f] - p = subprocess.Popen(args, stdout=subprocess.PIPE) - out = p.communicate()[0] - if p.returncode: - print >> sys.stderr, "error return code from hg" - sys.exit(1) - return out - - def main(srcfile): argv0 = sys.argv[0] components = argv0.split(os.sep) @@ -1155,7 +1128,6 @@ def main(srcfile): mod = asdl.parse(srcfile) if not asdl.check(mod): sys.exit(1) - mod.version = get_file_revision(srcfile) if INC_DIR: p = "%s/%s-ast.h" % (INC_DIR, mod.name) f = open(p, "w") @@ -1175,7 +1147,6 @@ def main(srcfile): p = os.path.join(SRC_DIR, str(mod.name) + "-ast.c") f = open(p, "w") f.write(auto_gen_msg) - f.write(c_file_msg % (mod.version,)) f.write('#include "Python.h"\n') f.write('#include "%s-ast.h"\n' % mod.name) f.write('\n') |