From 5d3d6299c9cfef5b62366482590edd3c241d9944 Mon Sep 17 00:00:00 2001 From: Hernan Grecco Date: Sat, 29 Apr 2023 22:44:43 -0300 Subject: Run pyupgrade --py39-plus in all files except _vendor (again) --- pint/facets/measurement/objects.py | 2 +- pint/facets/plain/registry.py | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) (limited to 'pint/facets') diff --git a/pint/facets/measurement/objects.py b/pint/facets/measurement/objects.py index 6fa860c..aaf5750 100644 --- a/pint/facets/measurement/objects.py +++ b/pint/facets/measurement/objects.py @@ -133,7 +133,7 @@ class Measurement(PlainQuantity): # scientific notation ('e' or 'E' and sometimes 'g' or 'G'). mstr = mstr.replace("(", "").replace(")", " ") ustr = siunitx_format_unit(self.units._units, self._REGISTRY) - return r"\SI{}{{{}}}{{{}}}".format(opts, mstr, ustr) + return rf"\SI{opts}{{{mstr}}}{{{ustr}}}" # standard cases if "L" in spec: diff --git a/pint/facets/plain/registry.py b/pint/facets/plain/registry.py index 035d151..a35e508 100644 --- a/pint/facets/plain/registry.py +++ b/pint/facets/plain/registry.py @@ -464,7 +464,7 @@ class PlainRegistry(metaclass=RegistryMeta): if self._on_redefinition == "raise": raise RedefinitionError(key, type(value)) elif self._on_redefinition == "warn": - logger.warning("Redefining '{}' ({})".format(key, type(value))) + logger.warning(f"Redefining '{key}' ({type(value)})") target_dict[key] = value if casei_target_dict is not None: -- cgit v1.2.1