summaryrefslogtreecommitdiff
path: root/Parser
diff options
context:
space:
mode:
authorNeal Norwitz <nnorwitz@gmail.com>2005-12-11 21:18:22 +0000
committerNeal Norwitz <nnorwitz@gmail.com>2005-12-11 21:18:22 +0000
commitbaed2ca53a3db96dbc86d2ef9d6ac8b41327237d (patch)
tree3b27f9111628604e5b60680897255d5efe7060b3 /Parser
parentae98ce86987894f3216a8d29709f799726e880de (diff)
downloadcpython-baed2ca53a3db96dbc86d2ef9d6ac8b41327237d.tar.gz
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.
Diffstat (limited to 'Parser')
-rwxr-xr-xParser/asdl_c.py6
1 files changed, 5 insertions, 1 deletions
diff --git a/Parser/asdl_c.py b/Parser/asdl_c.py
index d056c363af..2167c30542 100755
--- a/Parser/asdl_c.py
+++ b/Parser/asdl_c.py
@@ -638,7 +638,11 @@ class ChainOfVisitors:
v.emit("", 0)
def main(srcfile):
- auto_gen_msg = '/* File automatically generated by %s */\n' % sys.argv[0]
+ argv0 = sys.argv[0]
+ index = argv0.find('/')
+ if index > 0:
+ argv0 = argv0[index + 1:]
+ auto_gen_msg = '/* File automatically generated by %s */\n' % argv0
mod = asdl.parse(srcfile)
if not asdl.check(mod):
sys.exit(1)