aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorJason R. Coombs <jaraco@jaraco.com>2014-06-14 10:42:47 -0400
committerJason R. Coombs <jaraco@jaraco.com>2014-06-14 10:42:47 -0400
commit32beecb7ba01a9dad01068622cb365431f3a756a (patch)
treefd636a3557c2221f3d1b5a16f4c77766856db543
parentc0c0a82890bf8d06510f563aa3d01a69491ff86e (diff)
downloadexternal_python_setuptools-32beecb7ba01a9dad01068622cb365431f3a756a.tar.gz
external_python_setuptools-32beecb7ba01a9dad01068622cb365431f3a756a.tar.bz2
external_python_setuptools-32beecb7ba01a9dad01068622cb365431f3a756a.zip
Now that 2to3 is no longer run on the codebase, it's safe for the templates to be syntactically incorrect (prior to substitution).
-rwxr-xr-xsetuptools/command/easy_install.py8
-rw-r--r--setuptools/script template (dev).py6
-rw-r--r--setuptools/script template.py4
3 files changed, 6 insertions, 12 deletions
diff --git a/setuptools/command/easy_install.py b/setuptools/command/easy_install.py
index ad7f4725..19ed1259 100755
--- a/setuptools/command/easy_install.py
+++ b/setuptools/command/easy_install.py
@@ -743,15 +743,9 @@ Please make the appropriate changes for your system and try again.
"""
There are a couple of template scripts in the package. This
function loads one of them and prepares it for use.
-
- These templates use triple-quotes to escape variable
- substitutions so the scripts get the 2to3 treatment when build
- on Python 3. The templates cannot use triple-quotes naturally.
"""
raw_bytes = resource_string('setuptools', template_name)
- template_str = raw_bytes.decode('utf-8')
- clean_template = template_str.replace('"""', '')
- return clean_template
+ return raw_bytes.decode('utf-8')
if is_script:
# See https://bitbucket.org/pypa/setuptools/issue/134 for info
diff --git a/setuptools/script template (dev).py b/setuptools/script template (dev).py
index b3fe209e..c476673f 100644
--- a/setuptools/script template (dev).py
+++ b/setuptools/script template (dev).py
@@ -1,10 +1,10 @@
# EASY-INSTALL-DEV-SCRIPT: %(spec)r,%(script_name)r
-__requires__ = """%(spec)r"""
+__requires__ = %(spec)r
import sys
from pkg_resources import require
-require("""%(spec)r""")
+require(%(spec)r)
del require
-__file__ = """%(dev_path)r"""
+__file__ = %(dev_path)r
if sys.version_info < (3, 0):
execfile(__file__)
else:
diff --git a/setuptools/script template.py b/setuptools/script template.py
index 8dd5d510..4504e264 100644
--- a/setuptools/script template.py
+++ b/setuptools/script template.py
@@ -1,4 +1,4 @@
# EASY-INSTALL-SCRIPT: %(spec)r,%(script_name)r
-__requires__ = """%(spec)r"""
+__requires__ = %(spec)r
import pkg_resources
-pkg_resources.run_script("""%(spec)r""", """%(script_name)r""")
+pkg_resources.run_script(%(spec)r, %(script_name)r)