diff options
| author | Armin Rigo <arigo@tunes.org> | 2005-12-14 18:05:14 +0000 |
|---|---|---|
| committer | Armin Rigo <arigo@tunes.org> | 2005-12-14 18:05:14 +0000 |
| commit | c7bbc42517c7c4907dfa786af78fdabb4d7dd941 (patch) | |
| tree | 3bba1e5da782670be459ba85681de661f111c9b5 /Parser | |
| parent | 691ab34c4c81ec104aa32fda6295fdc298f48af5 (diff) | |
| download | cpython-c7bbc42517c7c4907dfa786af78fdabb4d7dd941.tar.gz | |
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-x | Parser/asdl_c.py | 5 |
1 files changed, 2 insertions, 3 deletions
diff --git a/Parser/asdl_c.py b/Parser/asdl_c.py index 2167c30542..f45bee450c 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): |
