From 52e28da4a00970b26cb00756bbce56b68f073f30 Mon Sep 17 00:00:00 2001 From: Eduardo Rodrigues Date: Tue, 4 Jun 2024 11:35:25 +0200 Subject: [PATCH] Fix 'UP031 Use format specifiers instead of percent format' --- src/skhep_testdata/remote_files.py | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/src/skhep_testdata/remote_files.py b/src/skhep_testdata/remote_files.py index b85216c..64065d5 100644 --- a/src/skhep_testdata/remote_files.py +++ b/src/skhep_testdata/remote_files.py @@ -27,7 +27,7 @@ def get_config_for_file(cls, filename: str) -> dict[str, str]: config = cls._all_files.get(filename, None) if not config: - raise RuntimeError("Unknown remote file: %s" % filename) + raise RuntimeError(f"Unknown remote file: {filename}") return config.copy() @@ -110,7 +110,7 @@ def remote_file( ) -> str: config = RemoteDatasetList.get_config_for_file(filename) if not config and raise_missing: - raise RuntimeError("Unknown %s cannot be found" % filename) + raise RuntimeError(f"Unknown {filename} cannot be found") return None path = os.path.join(data_dir, filename) @@ -119,6 +119,6 @@ def remote_file( fetch_remote_dataset(**config) # type: ignore[arg-type] if not os.path.isfile(path) and raise_missing: - raise RuntimeError("%s cannot be found" % filename) + raise RuntimeError(f"{filename} cannot be found") return path