Skip to content

Commit

Permalink
Extract variable for template string
Browse files Browse the repository at this point in the history
  • Loading branch information
jaraco committed Feb 1, 2016
1 parent 783fe0b commit 0dcee79
Showing 1 changed file with 12 additions and 11 deletions.
23 changes: 12 additions & 11 deletions pkg_resources/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -1174,22 +1174,23 @@ def extraction_error(self):
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
Expand Down

0 comments on commit 0dcee79

Please sign in to comment.