diff options
author | Jason R. Coombs <jaraco@jaraco.com> | 2014-06-15 08:31:33 -0400 |
---|---|---|
committer | Jason R. Coombs <jaraco@jaraco.com> | 2014-06-15 08:31:33 -0400 |
commit | 99475b7b9ca2650e265fb1d889710865f1fa35f2 (patch) | |
tree | df8b9bb11d4f5814717e4ee2bbe3da1d10e54b52 /setuptools/command/easy_install.py | |
parent | 80fe9c804ef7f69283cdd6e68e3b2f2da4e6f549 (diff) | |
download | python-setuptools-git-99475b7b9ca2650e265fb1d889710865f1fa35f2.tar.gz |
Moved filename resolution into _load_template
--HG--
extra : rebase_source : beb6c57dfd500432304518b9d313d1a98e2614b9
Diffstat (limited to 'setuptools/command/easy_install.py')
-rwxr-xr-x | setuptools/command/easy_install.py | 15 |
1 files changed, 8 insertions, 7 deletions
diff --git a/setuptools/command/easy_install.py b/setuptools/command/easy_install.py index 32852e07..a8ee6063 100755 --- a/setuptools/command/easy_install.py +++ b/setuptools/command/easy_install.py @@ -740,21 +740,22 @@ Please make the appropriate changes for your system and try again. is_script = is_python_script(script_text, script_name) if is_script: - # See https://bitbucket.org/pypa/setuptools/issue/134 for info - # on script file naming and downstream issues with SVR4 - template_name = 'script.tmpl' - if dev_path: - template_name = template_name.replace('.tmpl', ' (dev).tmpl') script_text = (get_script_header(script_text) + - self._load_template(template_name) % locals()) + self._load_template(dev_path) % locals()) self.write_script(script_name, _to_ascii(script_text), 'b') @staticmethod - def _load_template(name): + def _load_template(dev_path): """ There are a couple of template scripts in the package. This function loads one of them and prepares it for use. """ + # See https://bitbucket.org/pypa/setuptools/issue/134 for info + # on script file naming and downstream issues with SVR4 + name = 'script.tmpl' + if dev_path: + name = name.replace('.tmpl', ' (dev).tmpl') + raw_bytes = resource_string('setuptools', name) return raw_bytes.decode('utf-8') |