From 853a9df48cc056a07e17511a2b65918af9605bbc Mon Sep 17 00:00:00 2001 From: Ofekmeister Date: Tue, 16 Aug 2016 02:12:38 -0400 Subject: Fix issue #459 Patched sys.argv[0] before loading entry point --- setuptools/command/easy_install.py | 2 ++ setuptools/tests/test_easy_install.py | 2 ++ 2 files changed, 4 insertions(+) (limited to 'setuptools') diff --git a/setuptools/command/easy_install.py b/setuptools/command/easy_install.py index ae9079d8..e2a7dc46 100755 --- a/setuptools/command/easy_install.py +++ b/setuptools/command/easy_install.py @@ -2022,6 +2022,8 @@ class ScriptWriter(object): from pkg_resources import load_entry_point if __name__ == '__main__': + import re + 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..a4b1dfd5 100644 --- a/setuptools/tests/test_easy_install.py +++ b/setuptools/tests/test_easy_install.py @@ -78,6 +78,8 @@ class TestEasyInstallTest: from pkg_resources import load_entry_point if __name__ == '__main__': + import re + sys.argv[0] = re.sub(r'(-script\.pyw?|\.exe)?$', '', sys.argv[0]) sys.exit( load_entry_point('spec', 'console_scripts', 'name')() ) -- cgit v1.2.1