From 3ababa264dc404e9f8eae01045a4531b0b5bd692 Mon Sep 17 00:00:00 2001 From: "Jason R. Coombs" Date: Sun, 4 Jan 2015 21:31:05 -0500 Subject: Update install_scripts to use CommandSpec for generating script headers. --- setuptools/command/easy_install.py | 13 +++++++++++++ 1 file changed, 13 insertions(+) (limited to 'setuptools/command/easy_install.py') diff --git a/setuptools/command/easy_install.py b/setuptools/command/easy_install.py index bb0d8694..5667864b 100755 --- a/setuptools/command/easy_install.py +++ b/setuptools/command/easy_install.py @@ -1861,6 +1861,19 @@ class CommandSpec(list): _default = os.path.normpath(sys.executable) launcher = os.environ.get('__PYVENV_LAUNCHER__', _default) + @classmethod + def from_param(cls, param): + """ + Construct a CommandSpec from a parameter to build_scripts, which may + be None. + """ + if isinstance(param, cls): + return param + if param is None: + return cls.from_environment() + # otherwise, assume it's a string. + return cls.from_string(param) + @classmethod def from_environment(cls): return cls.from_string(cls.launcher) -- cgit v1.2.1