aboutsummaryrefslogtreecommitdiffstats
path: root/setuptools/sandbox.py
diff options
context:
space:
mode:
authorJason R. Coombs <jaraco@jaraco.com>2017-05-21 11:12:01 -0400
committerJason R. Coombs <jaraco@jaraco.com>2017-05-21 11:52:32 -0400
commitd6959fca54137c47abb9c3f7a0cbd1d0fd3704d3 (patch)
tree960d8a1a3e9e1e63d1d7d879cd8e5889383b58ee /setuptools/sandbox.py
parent7474f891cd5f62b0ef2af286096b47f8497e5d0d (diff)
downloadexternal_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-xsetuptools/sandbox.py21
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