summaryrefslogtreecommitdiffstats
path: root/Parser
diff options
context:
space:
mode:
authorArmin Rigo <arigo@tunes.org>2005-12-14 18:05:14 (GMT)
committerArmin Rigo <arigo@tunes.org>2005-12-14 18:05:14 (GMT)
commit6b1793ff8844d277047493915869c1ff98d4efd5 (patch)
treed12521fc2d712276ada5a69214538fdcf60b0175 /Parser
parentd39683396bf499aae0fd7978ac70a56e32407cab (diff)
downloadcpython-6b1793ff8844d277047493915869c1ff98d4efd5.zip
cpython-6b1793ff8844d277047493915869c1ff98d4efd5.tar.gz
cpython-6b1793ff8844d277047493915869c1ff98d4efd5.tar.bz2
When regenerating files like Python-ast.h, take care that the generated
comment based on 'sys.args[0]' does not depend on the path. For Python builds from a remote directory ("/path/to/configure; make") the previous logic used to include the "/path/to" portion in Python-ast.h. Then svn would consider this file to be locally modified.
Diffstat (limited to 'Parser')
-rwxr-xr-xParser/asdl_c.py5
1 files changed, 2 insertions, 3 deletions
diff --git a/Parser/asdl_c.py b/Parser/asdl_c.py
index 2167c30..f45bee4 100755
--- a/Parser/asdl_c.py
+++ b/Parser/asdl_c.py
@@ -639,9 +639,8 @@ class ChainOfVisitors:
def main(srcfile):
argv0 = sys.argv[0]
- index = argv0.find('/')
- if index > 0:
- argv0 = argv0[index + 1:]
+ components = argv0.split(os.sep)
+ argv0 = os.sep.join(components[-2:])
auto_gen_msg = '/* File automatically generated by %s */\n' % argv0
mod = asdl.parse(srcfile)
if not asdl.check(mod):