diff options
author | Patrick Lehmann <Patrick.Lehmann@plc2.de> | 2022-11-28 00:32:17 +0100 |
---|---|---|
committer | Patrick Lehmann <Patrick.Lehmann@plc2.de> | 2022-11-30 23:32:47 +0100 |
commit | 51f0ead16d60c63d1b069f807e3513bba11d8947 (patch) | |
tree | 50094f57aeb7f9562341908864624199f4d7bc4a /scripts/pnodes.py | |
parent | 473ed87bb505916e74441f01508c109bf39b30a7 (diff) | |
download | ghdl-51f0ead16d60c63d1b069f807e3513bba11d8947.tar.gz ghdl-51f0ead16d60c63d1b069f807e3513bba11d8947.tar.bz2 ghdl-51f0ead16d60c63d1b069f807e3513bba11d8947.zip |
Converted string formatting to f-strings.
Diffstat (limited to 'scripts/pnodes.py')
-rwxr-xr-x | scripts/pnodes.py | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/scripts/pnodes.py b/scripts/pnodes.py index ec00a54ac..29a2909c0 100755 --- a/scripts/pnodes.py +++ b/scripts/pnodes.py @@ -73,7 +73,7 @@ class ParseError(Exception): self.msg = msg def __str__(self): - return ("Parse error at {lr.filename}:{lr.lineno}: {msg}".format(lr=self.lr, msg=self.msg)) + return f"Parse error at {self.lr.filename}:{self.lr.lineno}: {self.msg}" # Return fields description. @@ -328,7 +328,7 @@ def read_nodes_fields(lr, names, fields, nodes, funcs_dict): cur_nodes = [] for (nm, fmt) in names: if fmt not in fields: - raise ParseError(lr, 'unknown format "{}"'.format(fmt)) + raise ParseError(lr, f'unknown format "{fmt}"') n = NodeDesc(nm, fmt, {x: None for x in fields[fmt]}, {}) nodes[nm] = n cur_nodes.append(n) |