Skip to content

Commit

Permalink
Reduce local variable count.
Browse files Browse the repository at this point in the history
  • Loading branch information
rossbar committed Mar 8, 2024
1 parent 1bf826a commit 5912daa
Showing 1 changed file with 1 addition and 2 deletions.
3 changes: 1 addition & 2 deletions networkx/algorithms/approximation/steinertree.py
Original file line number Diff line number Diff line change
Expand Up @@ -200,8 +200,7 @@ def steiner_tree(G, terminal_nodes, weight="weight", method=None):
try:
algo = ALGORITHMS[method]
except KeyError as e:
msg = f"{method} is not a valid choice for an algorithm."
raise ValueError(msg) from e
raise ValueError(f"{method} is not a valid choice for an algorithm.") from e

edges = algo(G, terminal_nodes, weight)
# For multigraph we should add the minimal weight edge keys
Expand Down

0 comments on commit 5912daa

Please sign in to comment.