diff options
Diffstat (limited to 'setuptools')
| -rwxr-xr-x | setuptools/command/easy_install.py | 2 | ||||
| -rw-r--r-- | setuptools/tests/test_easy_install.py | 2 |
2 files changed, 4 insertions, 0 deletions
diff --git a/setuptools/command/easy_install.py b/setuptools/command/easy_install.py index ae9079d8..5065661f 100755 --- a/setuptools/command/easy_install.py +++ b/setuptools/command/easy_install.py @@ -2018,10 +2018,12 @@ class ScriptWriter(object): template = textwrap.dedent(""" # EASY-INSTALL-ENTRY-SCRIPT: %(spec)r,%(group)r,%(name)r __requires__ = %(spec)r + import re import sys from pkg_resources import load_entry_point if __name__ == '__main__': + sys.argv[0] = re.sub(r'(-script\.pyw?|\.exe)?$', '', sys.argv[0]) sys.exit( load_entry_point(%(spec)r, %(group)r, %(name)r)() ) diff --git a/setuptools/tests/test_easy_install.py b/setuptools/tests/test_easy_install.py index da0a355c..82e1d7e8 100644 --- a/setuptools/tests/test_easy_install.py +++ b/setuptools/tests/test_easy_install.py @@ -74,10 +74,12 @@ class TestEasyInstallTest: expected = header + DALS(""" # EASY-INSTALL-ENTRY-SCRIPT: 'spec','console_scripts','name' __requires__ = 'spec' + import re import sys from pkg_resources import load_entry_point if __name__ == '__main__': + sys.argv[0] = re.sub(r'(-script\.pyw?|\.exe)?$', '', sys.argv[0]) sys.exit( load_entry_point('spec', 'console_scripts', 'name')() ) |
