Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Commit 8560bb8

Browse files
author
Thomas Heller
committed
Fix a small bug when sys.argv[0] has an absolute path.
See http://mail.python.org/pipermail/distutils-sig/2002-November/003039.html
1 parent 5b470e0 commit 8560bb8

1 file changed

Lines changed: 1 addition & 1 deletion

File tree

Lib/distutils/core.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -87,7 +87,7 @@ class found in 'cmdclass' is used in place of the default, which is
8787
klass = Distribution
8888

8989
if not attrs.has_key('script_name'):
90-
attrs['script_name'] = sys.argv[0]
90+
attrs['script_name'] = os.path.basename(sys.argv[0])
9191
if not attrs.has_key('script_args'):
9292
attrs['script_args'] = sys.argv[1:]
9393

0 commit comments

Comments
 (0)