@@ -900,10 +900,6 @@ def visitModule(self, mod):
900900 self .emit ('if (PyDict_SetItemString(d, "AST", (PyObject*)&AST_type) < 0) return NULL;' , 1 )
901901 self .emit ('if (PyModule_AddIntConstant(m, "PyCF_ONLY_AST", PyCF_ONLY_AST) < 0)' , 1 )
902902 self .emit ("return NULL;" , 2 )
903- # Value of version: "$Revision$"
904- self .emit ('if (PyModule_AddStringConstant(m, "__version__", "%s") < 0)'
905- % (mod .version ,), 1 )
906- self .emit ("return NULL;" , 2 )
907903 for dfn in mod .dfns :
908904 self .visit (dfn )
909905 self .emit ("return m;" , 1 )
@@ -1124,29 +1120,6 @@ def visit(self, object):
11241120
11251121common_msg = "/* File automatically generated by %s. */\n \n "
11261122
1127- c_file_msg = """
1128- /*
1129- __version__ %s.
1130-
1131- This module must be committed separately after each AST grammar change;
1132- The __version__ number is set to the revision number of the commit
1133- containing the grammar change.
1134- */
1135-
1136- """
1137-
1138-
1139- def get_file_revision (f ):
1140- """Fish out the last change to a file in hg."""
1141- args = ["hg" , "log" , "--template" , "{node|short}" , "--limit" , "1" , f ]
1142- p = subprocess .Popen (args , stdout = subprocess .PIPE )
1143- out = p .communicate ()[0 ]
1144- if p .returncode :
1145- print >> sys .stderr , "error return code from hg"
1146- sys .exit (1 )
1147- return out
1148-
1149-
11501123def main (srcfile ):
11511124 argv0 = sys .argv [0 ]
11521125 components = argv0 .split (os .sep )
@@ -1155,7 +1128,6 @@ def main(srcfile):
11551128 mod = asdl .parse (srcfile )
11561129 if not asdl .check (mod ):
11571130 sys .exit (1 )
1158- mod .version = get_file_revision (srcfile )
11591131 if INC_DIR :
11601132 p = "%s/%s-ast.h" % (INC_DIR , mod .name )
11611133 f = open (p , "w" )
@@ -1175,7 +1147,6 @@ def main(srcfile):
11751147 p = os .path .join (SRC_DIR , str (mod .name ) + "-ast.c" )
11761148 f = open (p , "w" )
11771149 f .write (auto_gen_msg )
1178- f .write (c_file_msg % (mod .version ,))
11791150 f .write ('#include "Python.h"\n ' )
11801151 f .write ('#include "%s-ast.h"\n ' % mod .name )
11811152 f .write ('\n ' )
0 commit comments