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

Skip to content

Commit 897ff81

Browse files
committed
SF #1373150, diffs in working copy after a build
Strip off leading dots and slash so the generated files are the same regardless of whether you configure in the checkout directory or build. If anyone configures in a different directory, we might want a cleaner approach using os.path.*(). Hopefully this is good enough.
1 parent ba2fa63 commit 897ff81

3 files changed

Lines changed: 7 additions & 3 deletions

File tree

Include/Python-ast.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
/* File automatically generated by ./Parser/asdl_c.py */
1+
/* File automatically generated by Parser/asdl_c.py */
22

33
#include "asdl.h"
44

Parser/asdl_c.py

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -638,7 +638,11 @@ def visit(self, object):
638638
v.emit("", 0)
639639

640640
def main(srcfile):
641-
auto_gen_msg = '/* File automatically generated by %s */\n' % sys.argv[0]
641+
argv0 = sys.argv[0]
642+
index = argv0.find('/')
643+
if index > 0:
644+
argv0 = argv0[index + 1:]
645+
auto_gen_msg = '/* File automatically generated by %s */\n' % argv0
642646
mod = asdl.parse(srcfile)
643647
if not asdl.check(mod):
644648
sys.exit(1)

Python/Python-ast.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
/* File automatically generated by ./Parser/asdl_c.py */
1+
/* File automatically generated by Parser/asdl_c.py */
22

33
#include "Python.h"
44
#include "Python-ast.h"

0 commit comments

Comments
 (0)