Commit 74ef430b authored by jim's avatar jim

Bug fixed:

  Scripts run using generated interpreters didn't have __file__ set correctly.


git-svn-id: http://svn.zope.org/repos/main/zc.buildout/trunk@103353 62d5b8a3-27da-0310-9561-8e5933582275
parent 1effb226
......@@ -20,6 +20,8 @@ Bugs fixed:
- Scripts generated with relative-paths eanbled couldn't be
symbolocally linked to other locations and still work.
- Scripts run using generated interpreters didn't have __file__ set correctly.
1.4.0 (2009-08-26)
==================
......
......@@ -16,8 +16,6 @@
This module provides a high-level Python API for installing packages.
It doesn't install scripts. It uses setuptools and requires it to be
installed.
$Id$
"""
import distutils.errors
......@@ -1140,7 +1138,8 @@ if len(sys.argv) > 1:
if _args:
sys.argv[:] = _args
execfile(sys.argv[0])
__file__ = _args[0]
execfile(__file__)
if _interactive:
import code
......
......@@ -683,7 +683,8 @@ the path set:
<BLANKLINE>
if _args:
sys.argv[:] = _args
execfile(sys.argv[0])
__file__ = _args[0]
execfile(__file__)
<BLANKLINE>
if _interactive:
import code
......@@ -691,6 +692,15 @@ the path set:
If invoked with a script name and arguments, it will run that script, instead.
>>> write('ascript', '''
... "demo doc"
... print sys.argv
... print (__name__, __file__, __doc__)
... ''')
>>> print system(join(bin, 'py')+' ascript a b c'),
['ascript', 'a', 'b', 'c']
('__main__', 'ascript', 'demo doc')
An additional argument can be passed to define which scripts to install
and to provide script names. The argument is a dictionary mapping
original script names to new script names.
......@@ -874,7 +884,8 @@ We specified an interpreter and its paths are adjusted too:
<BLANKLINE>
if _args:
sys.argv[:] = _args
execfile(sys.argv[0])
__file__ = _args[0]
execfile(__file__)
<BLANKLINE>
if _interactive:
import code
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment