1
0
mirror of https://github.com/home-assistant/core.git synced 2025-12-24 21:06:19 +00:00

Use literal string interpolation in core (f-strings) (#26166)

This commit is contained in:
Franck Nijhof
2019-08-23 18:53:33 +02:00
committed by Paulus Schoutsen
parent 1efa29d6ff
commit decf13b948
67 changed files with 180 additions and 246 deletions

View File

@@ -34,7 +34,7 @@ def convert(value: float, unit_1: str, unit_2: str) -> float:
raise ValueError(UNIT_NOT_RECOGNIZED_TEMPLATE.format(unit_2, PRESSURE))
if not isinstance(value, Number):
raise TypeError("{} is not of numeric type".format(value))
raise TypeError(f"{value} is not of numeric type")
# type ignore: https://github.com/python/mypy/issues/7207
if unit_1 == unit_2 or unit_1 not in VALID_UNITS: # type: ignore