summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJason R. Coombs <jaraco@jaraco.com>2016-01-31 21:35:13 -0500
committerJason R. Coombs <jaraco@jaraco.com>2016-01-31 21:35:13 -0500
commit0dcee791dfdcfacddaaec79b29f30a347a147413 (patch)
tree0eef36cd1d8f8390f4d94d1ea33fce23042a960b
parent783fe0bbcec577fcca5f5fbc247c2b0b86697721 (diff)
downloadpython-setuptools-git-0dcee791dfdcfacddaaec79b29f30a347a147413.tar.gz
Extract variable for template string
-rw-r--r--pkg_resources/__init__.py23
1 files changed, 12 insertions, 11 deletions
diff --git a/pkg_resources/__init__.py b/pkg_resources/__init__.py
index 7ba23bf5..4fdc5f91 100644
--- a/pkg_resources/__init__.py
+++ b/pkg_resources/__init__.py
@@ -1174,22 +1174,23 @@ class ResourceManager:
old_exc = sys.exc_info()[1]
cache_path = self.extraction_path or get_default_cache()
- err = ExtractionError("""Can't extract file(s) to egg cache
+ tmpl = textwrap.dedent("""
+ Can't extract file(s) to egg cache
-The following error occurred while trying to extract file(s) to the Python egg
-cache:
+ The following error occurred while trying to extract file(s) to the Python egg
+ cache:
- %s
+ %s
-The Python egg cache directory is currently set to:
+ The Python egg cache directory is currently set to:
- %s
+ %s
-Perhaps your account does not have write access to this directory? You can
-change the cache directory by setting the PYTHON_EGG_CACHE environment
-variable to point to an accessible directory.
-""" % (old_exc, cache_path)
- )
+ Perhaps your account does not have write access to this directory? You can
+ change the cache directory by setting the PYTHON_EGG_CACHE environment
+ variable to point to an accessible directory.
+ """).lstrip()
+ err = ExtractionError(tmpl % (old_exc, cache_path))
err.manager = self
err.cache_path = cache_path
err.original_error = old_exc