mirror of
https://github.com/python/cpython.git
synced 2025-11-24 20:30:18 +00:00
- 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:
parent
2b860db35c
commit
46c58c17f1
3 changed files with 46 additions and 1 deletions
|
|
@ -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
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue