- Issue #2385: distutils.core.run_script() makes __file__ available, so the

controlled environment will more closely mirror the typical script
  environment.  This supports setup.py scripts that refer to data files.
This commit is contained in:
Fred Drake 2008-04-04 05:41:30 +00:00
parent 2b860db35c
commit 46c58c17f1
3 changed files with 46 additions and 1 deletions

View file

@ -210,8 +210,9 @@ def run_setup (script_name, script_args=None, stop_after="run"):
_setup_stop_after = stop_after
save_argv = sys.argv
g = {}
g = {'__file__': script_name}
l = {}
os.chdir(os.path.dirname(script_name) or os.curdir)
try:
try:
sys.argv[0] = script_name