[Python-checkins] commit of r41671 - python/trunk/Parser/asdl_c.py

Neal Norwitz nnorwitz at gmail.com
Wed Dec 14 19:47:02 CET 2005


Thank you, much nicer than the crap I wrote.  The original argv0 =
isn't really necessary if the next line is components =
sys.argv[0].split(...)

n
--

On 12/14/05, armin.rigo <python-checkins at python.org> wrote:
> Author: armin.rigo
> Date: Wed Dec 14 19:05:14 2005
> New Revision: 41671
>
> Modified:
>    python/trunk/Parser/asdl_c.py
> Log:
> 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.
>
>
> Modified: python/trunk/Parser/asdl_c.py
> ==============================================================================
> --- python/trunk/Parser/asdl_c.py       (original)
> +++ python/trunk/Parser/asdl_c.py       Wed Dec 14 19:05:14 2005
> @@ -639,9 +639,8 @@
>
>  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):
> _______________________________________________
> Python-checkins mailing list
> Python-checkins at python.org
> http://mail.python.org/mailman/listinfo/python-checkins
>


More information about the Python-checkins mailing list