Skip to content

Commit 05485c0

Browse files
authored
Merge pull request #9594 from hexagonrecursion/fstring
2 parents 6ff1f7d + afecf80 commit 05485c0

File tree

4 files changed

+7
-7
lines changed

4 files changed

+7
-7
lines changed

src/pip/_internal/network/utils.py

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -42,12 +42,12 @@ def raise_for_status(resp):
4242
reason = resp.reason
4343

4444
if 400 <= resp.status_code < 500:
45-
http_error_msg = '%s Client Error: %s for url: %s' % (
46-
resp.status_code, reason, resp.url)
45+
http_error_msg = (
46+
f'{resp.status_code} Client Error: {reason} for url: {resp.url}')
4747

4848
elif 500 <= resp.status_code < 600:
49-
http_error_msg = '%s Server Error: %s for url: %s' % (
50-
resp.status_code, reason, resp.url)
49+
http_error_msg = (
50+
f'{resp.status_code} Server Error: {reason} for url: {resp.url}')
5151

5252
if http_error_msg:
5353
raise NetworkConnectionError(http_error_msg, response=resp)

src/pip/_internal/resolution/resolvelib/requirements.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -166,7 +166,7 @@ def __init__(self, name):
166166

167167
def __str__(self):
168168
# type: () -> str
169-
return "{} (unavailable)".format(self._name)
169+
return f"{self._name} (unavailable)"
170170

171171
def __repr__(self):
172172
# type: () -> str

src/pip/_internal/utils/misc.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -241,7 +241,7 @@ def strtobool(val):
241241
elif val in ("n", "no", "f", "false", "off", "0"):
242242
return 0
243243
else:
244-
raise ValueError("invalid truth value %r" % (val,))
244+
raise ValueError(f"invalid truth value {val!r}")
245245

246246

247247
def format_size(bytes):

src/pip/_internal/wheel_builder.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -187,7 +187,7 @@ def _verify_one(req, wheel_path):
187187
try:
188188
metadata_version = Version(metadata_version_value)
189189
except InvalidVersion:
190-
msg = "Invalid Metadata-Version: {}".format(metadata_version_value)
190+
msg = f"Invalid Metadata-Version: {metadata_version_value}"
191191
raise UnsupportedWheel(msg)
192192
if (metadata_version >= Version("1.2")
193193
and not isinstance(dist.version, Version)):

0 commit comments

Comments
 (0)