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

Skip to content

Commit 17f641c

Browse files
committed
Fixed 'select_scheme()' so it doesn't override a directory attribute that's
already been set (eg. by a command-line option).
1 parent 74ead8f commit 17f641c

1 file changed

Lines changed: 3 additions & 1 deletion

File tree

Lib/distutils/command/install.py

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -356,7 +356,9 @@ def select_scheme (self, name):
356356
# it's the caller's problem if they supply a bad name!
357357
scheme = INSTALL_SCHEMES[name]
358358
for key in ('purelib', 'platlib', 'scripts', 'data'):
359-
setattr (self, 'install_' + key, scheme[key])
359+
attrname = 'install_' + key
360+
if getattr(self, attrname) is None:
361+
setattr(self, attrname, scheme[key])
360362

361363

362364
def _expand_attrs (self, attrs):

0 commit comments

Comments
 (0)