Use f-strings

Now that minimum python supported is 3.6, we can use f-strings !
This commit is contained in:
mayeut
2020-05-09 11:53:20 +02:00
parent ac0012e3da
commit 5e767fcc9a
9 changed files with 33 additions and 40 deletions
+2 -2
View File
@@ -20,7 +20,7 @@ def evaluate(value: str, environment: Dict[str, str]) -> str:
command_node = bashlex.parsesingle(value)
if len(command_node.parts) != 1:
raise ValueError('"%s" has too many parts' % value)
raise ValueError(f'"{value}" has too many parts')
value_word_node = command_node.parts[0]
@@ -38,7 +38,7 @@ def evaluate_node(node: bashlex.ast.node, context: NodeExecutionContext) -> str:
elif node.kind == 'parameter':
return evaluate_parameter_node(node, context=context)
else:
raise ValueError('Unsupported bash construct: "%s"' % node.word)
raise ValueError(f'Unsupported bash construct: "{node.word}"')
def evaluate_word_node(node: bashlex.ast.node, context: NodeExecutionContext) -> str: