Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Commit efad244

Browse files
committed
hardcode the old svn __version__
1 parent 2193d2b commit efad244

2 files changed

Lines changed: 5 additions & 7 deletions

File tree

Parser/asdl_c.py

Lines changed: 3 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -899,9 +899,6 @@ def visitConstructor(self, cons, name, simple):
899899
self.emit("if (!%s_singleton) return 0;" % cons.name, 1)
900900

901901

902-
def parse_version(mod):
903-
return mod.version.value[12:-3]
904-
905902
class ASTModuleVisitor(PickleVisitor):
906903

907904
def visitModule(self, mod):
@@ -921,7 +918,7 @@ def visitModule(self, mod):
921918
self.emit("return NULL;", 2)
922919
# Value of version: "$Revision$"
923920
self.emit('if (PyModule_AddStringConstant(m, "__version__", "%s") < 0)'
924-
% parse_version(mod), 1)
921+
% mod.version, 1)
925922
self.emit("return NULL;", 2)
926923
for dfn in mod.dfns:
927924
self.visit(dfn)
@@ -1160,6 +1157,7 @@ def main(srcfile):
11601157
argv0 = os.sep.join(components[-2:])
11611158
auto_gen_msg = common_msg % argv0
11621159
mod = asdl.parse(srcfile)
1160+
mod.version = "82163"
11631161
if not asdl.check(mod):
11641162
sys.exit(1)
11651163
if INC_DIR:
@@ -1181,7 +1179,7 @@ def main(srcfile):
11811179
p = os.path.join(SRC_DIR, str(mod.name) + "-ast.c")
11821180
f = open(p, "w")
11831181
f.write(auto_gen_msg)
1184-
f.write(c_file_msg % parse_version(mod))
1182+
f.write(c_file_msg % mod.version)
11851183
f.write('#include "Python.h"\n')
11861184
f.write('#include "%s-ast.h"\n' % mod.name)
11871185
f.write('\n')

Python/Python-ast.c

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22

33

44
/*
5-
__version__ .
5+
__version__ 82163.
66
77
This module must be committed separately after each AST grammar change;
88
The __version__ number is set to the revision number of the commit
@@ -6756,7 +6756,7 @@ PyInit__ast(void)
67566756
NULL;
67576757
if (PyModule_AddIntConstant(m, "PyCF_ONLY_AST", PyCF_ONLY_AST) < 0)
67586758
return NULL;
6759-
if (PyModule_AddStringConstant(m, "__version__", "") < 0)
6759+
if (PyModule_AddStringConstant(m, "__version__", "82163") < 0)
67606760
return NULL;
67616761
if (PyDict_SetItemString(d, "mod", (PyObject*)mod_type) < 0) return
67626762
NULL;

0 commit comments

Comments
 (0)