Skip to content

Commit 0dcee79

Browse files
committed
Extract variable for template string
1 parent 783fe0b commit 0dcee79

File tree

1 file changed

+12
-11
lines changed

1 file changed

+12
-11
lines changed

pkg_resources/__init__.py

+12-11
Original file line numberDiff line numberDiff line change
@@ -1174,22 +1174,23 @@ def extraction_error(self):
11741174
old_exc = sys.exc_info()[1]
11751175
cache_path = self.extraction_path or get_default_cache()
11761176

1177-
err = ExtractionError("""Can't extract file(s) to egg cache
1177+
tmpl = textwrap.dedent("""
1178+
Can't extract file(s) to egg cache
11781179
1179-
The following error occurred while trying to extract file(s) to the Python egg
1180-
cache:
1180+
The following error occurred while trying to extract file(s) to the Python egg
1181+
cache:
11811182
1182-
%s
1183+
%s
11831184
1184-
The Python egg cache directory is currently set to:
1185+
The Python egg cache directory is currently set to:
11851186
1186-
%s
1187+
%s
11871188
1188-
Perhaps your account does not have write access to this directory? You can
1189-
change the cache directory by setting the PYTHON_EGG_CACHE environment
1190-
variable to point to an accessible directory.
1191-
""" % (old_exc, cache_path)
1192-
)
1189+
Perhaps your account does not have write access to this directory? You can
1190+
change the cache directory by setting the PYTHON_EGG_CACHE environment
1191+
variable to point to an accessible directory.
1192+
""").lstrip()
1193+
err = ExtractionError(tmpl % (old_exc, cache_path))
11931194
err.manager = self
11941195
err.cache_path = cache_path
11951196
err.original_error = old_exc

0 commit comments

Comments
 (0)