summaryrefslogtreecommitdiff
path: root/pylint/graph.py
diff options
context:
space:
mode:
authorPierre Sassoulas <pierre.sassoulas@gmail.com>2021-02-21 13:27:11 +0100
committerPierre Sassoulas <pierre.sassoulas@gmail.com>2021-02-21 15:36:16 +0100
commit5bed07eba999130b6551acc7c43192d6a8eada43 (patch)
tree09e3a11503bd074363556e8a5fd33fc0e8db7fc4 /pylint/graph.py
parenta1e553d3bb07c56ca99c31279f9af104bede0a32 (diff)
downloadpylint-git-5bed07eba999130b6551acc7c43192d6a8eada43.tar.gz
Move from % string formatting syntax to f-string or .format()
Diffstat (limited to 'pylint/graph.py')
-rw-r--r--pylint/graph.py8
1 files changed, 4 insertions, 4 deletions
diff --git a/pylint/graph.py b/pylint/graph.py
index b1fe460d8..e689a6883 100644
--- a/pylint/graph.py
+++ b/pylint/graph.py
@@ -134,16 +134,16 @@ class DotBackend:
"""emit an edge from <name1> to <name2>.
edge properties: see https://www.graphviz.org/doc/info/attrs.html
"""
- attrs = ['%s="%s"' % (prop, value) for prop, value in props.items()]
+ attrs = [f'{prop}="{value}"' for prop, value in props.items()]
n_from, n_to = normalize_node_id(name1), normalize_node_id(name2)
- self.emit("%s -> %s [%s];" % (n_from, n_to, ", ".join(sorted(attrs))))
+ self.emit("{} -> {} [{}];".format(n_from, n_to, ", ".join(sorted(attrs))))
def emit_node(self, name, **props):
"""emit a node with given properties.
node properties: see https://www.graphviz.org/doc/info/attrs.html
"""
- attrs = ['%s="%s"' % (prop, value) for prop, value in props.items()]
- self.emit("%s [%s];" % (normalize_node_id(name), ", ".join(sorted(attrs))))
+ attrs = [f'{prop}="{value}"' for prop, value in props.items()]
+ self.emit("{} [{}];".format(normalize_node_id(name), ", ".join(sorted(attrs))))
def normalize_node_id(nid):