diff options
author | Eli Schwartz <eschwartz@archlinux.org> | 2021-10-28 23:01:31 -0400 |
---|---|---|
committer | Eli Schwartz <eschwartz@archlinux.org> | 2021-11-01 20:26:18 -0400 |
commit | 038b31e72bc02f0a9bdc6d8613992a5c344e8650 (patch) | |
tree | f24c7216b2b2934b1d1c7a87cc6727d5a193bcf0 /mesonbuild/modules/hotdoc.py | |
parent | bae0fdf64ac697b264bdb5eb93dcb160b3e7f6b2 (diff) | |
download | meson-038b31e72bc02f0a9bdc6d8613992a5c344e8650.zip meson-038b31e72bc02f0a9bdc6d8613992a5c344e8650.tar.gz meson-038b31e72bc02f0a9bdc6d8613992a5c344e8650.tar.bz2 |
various manual conversion of percent-formatted strings to f-strings
Diffstat (limited to 'mesonbuild/modules/hotdoc.py')
-rw-r--r-- | mesonbuild/modules/hotdoc.py | 13 |
1 files changed, 6 insertions, 7 deletions
diff --git a/mesonbuild/modules/hotdoc.py b/mesonbuild/modules/hotdoc.py index 9a41aa5..1b89d50 100644 --- a/mesonbuild/modules/hotdoc.py +++ b/mesonbuild/modules/hotdoc.py @@ -135,12 +135,11 @@ class HotdocTargetBuilder: if force_list and not isinstance(value, list): return [value], uvalue return value, uvalue - raise MesonException("%s field value %s is not valid," - " valid types are %s" % (argname, value, - types)) + raise MesonException(f"{argname} field value {value} is not valid," + f" valid types are {types}") except KeyError: if mandatory: - raise MesonException("%s mandatory field not found" % argname) + raise MesonException(f"{argname} mandatory field not found") if default is not None: return default, default @@ -279,14 +278,14 @@ class HotdocTargetBuilder: _dir = os.path.join(self.sourcedir, self.subdir, value) if not os.path.isdir(_dir): - raise InvalidArguments('"%s" is not a directory.' % _dir) + raise InvalidArguments(f'"{_dir}" is not a directory.') return os.path.relpath(_dir, os.path.join(self.builddir, self.subdir)) def check_forbidden_args(self): for arg in ['conf_file']: if arg in self.kwargs: - raise InvalidArguments('Argument "%s" is forbidden.' % arg) + raise InvalidArguments(f'Argument "{arg}" is forbidden.') def add_include_path(self, path): self.include_paths[path] = path @@ -414,7 +413,7 @@ class HotDocModule(ExtensionModule): @noKwargs def has_extensions(self, state, args, kwargs): - return self.hotdoc.run_hotdoc(['--has-extension=%s' % extension for extension in args]) == 0 + return self.hotdoc.run_hotdoc([f'--has-extension={extension}' for extension in args]) == 0 def generate_doc(self, state, args, kwargs): if len(args) != 1: |