]> granicus.if.org Git - python/commitdiff
SF #1373150, diffs in working copy after a build
authorNeal Norwitz <nnorwitz@gmail.com>
Sun, 11 Dec 2005 21:18:22 +0000 (21:18 +0000)
committerNeal Norwitz <nnorwitz@gmail.com>
Sun, 11 Dec 2005 21:18:22 +0000 (21:18 +0000)
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.

Include/Python-ast.h
Parser/asdl_c.py
Python/Python-ast.c

index 9609141c046665821690b31968701a990cbd3e53..2484bb13d404ddb1051cc1bae8823252bca7005d 100644 (file)
@@ -1,4 +1,4 @@
-/* File automatically generated by ./Parser/asdl_c.py */
+/* File automatically generated by Parser/asdl_c.py */
 
 #include "asdl.h"
 
index d056c363aff516fa51cde9b10449f0c3d35eafd1..2167c30542927d221a0f138500487282c3d85ead 100755 (executable)
@@ -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)
index 14040adc53b009627be1e8133391ad0943e21928..b2766251b189ec5cd31210f6a32f7544cd9019d9 100644 (file)
@@ -1,4 +1,4 @@
-/* File automatically generated by ./Parser/asdl_c.py */
+/* File automatically generated by Parser/asdl_c.py */
 
 #include "Python.h"
 #include "Python-ast.h"