diff options
author | Jason R. Coombs <jaraco@jaraco.com> | 2017-05-21 11:12:01 -0400 |
---|---|---|
committer | Jason R. Coombs <jaraco@jaraco.com> | 2017-05-21 11:52:32 -0400 |
commit | d6959fca54137c47abb9c3f7a0cbd1d0fd3704d3 (patch) | |
tree | 960d8a1a3e9e1e63d1d7d879cd8e5889383b58ee /setuptools/sandbox.py | |
parent | 7474f891cd5f62b0ef2af286096b47f8497e5d0d (diff) | |
download | external_python_setuptools-d6959fca54137c47abb9c3f7a0cbd1d0fd3704d3.tar.gz external_python_setuptools-d6959fca54137c47abb9c3f7a0cbd1d0fd3704d3.tar.bz2 external_python_setuptools-d6959fca54137c47abb9c3f7a0cbd1d0fd3704d3.zip |
Use dedent and left strip to store the template inside the class.
Diffstat (limited to 'setuptools/sandbox.py')
-rwxr-xr-x | setuptools/sandbox.py | 21 |
1 files changed, 13 insertions, 8 deletions
diff --git a/setuptools/sandbox.py b/setuptools/sandbox.py index 9c4ff336..4711fec2 100755 --- a/setuptools/sandbox.py +++ b/setuptools/sandbox.py @@ -7,6 +7,7 @@ import itertools import re import contextlib import pickle +import textwrap import six from six.moves import builtins, map @@ -476,13 +477,17 @@ WRITE_FLAGS = functools.reduce( class SandboxViolation(DistutilsError): """A setup script attempted to modify the filesystem outside the sandbox""" - def __str__(self): - return """SandboxViolation: %s%r %s + tmpl = textwrap.dedent(""" + SandboxViolation: %s%r %s + + The package setup script has attempted to modify files on your system + that are not within the EasyInstall build area, and has been aborted. -The package setup script has attempted to modify files on your system -that are not within the EasyInstall build area, and has been aborted. + This package cannot be safely installed by EasyInstall, and may not + support alternate installation locations even if you run its setup + script by hand. Please inform the package's author and the EasyInstall + maintainers to find out if a fix or workaround is available. + """).lstrip() -This package cannot be safely installed by EasyInstall, and may not -support alternate installation locations even if you run its setup -script by hand. Please inform the package's author and the EasyInstall -maintainers to find out if a fix or workaround is available.""" % self.args + def __str__(self): + return self.tmpl % self.args |