Commit d6959fca authored by Jason R. Coombs's avatar Jason R. Coombs

Use dedent and left strip to store the template inside the class.

parent 7474f891
...@@ -7,6 +7,7 @@ import itertools ...@@ -7,6 +7,7 @@ import itertools
import re import re
import contextlib import contextlib
import pickle import pickle
import textwrap
import six import six
from six.moves import builtins, map from six.moves import builtins, map
...@@ -476,13 +477,17 @@ WRITE_FLAGS = functools.reduce( ...@@ -476,13 +477,17 @@ WRITE_FLAGS = functools.reduce(
class SandboxViolation(DistutilsError): class SandboxViolation(DistutilsError):
"""A setup script attempted to modify the filesystem outside the sandbox""" """A setup script attempted to modify the filesystem outside the sandbox"""
def __str__(self): tmpl = textwrap.dedent("""
return """SandboxViolation: %s%r %s 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 This package cannot be safely installed by EasyInstall, and may not
that are not within the EasyInstall build area, and has been aborted. 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 def __str__(self):
support alternate installation locations even if you run its setup return self.tmpl % self.args
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
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment