Commit b9c66f41 authored by Stefan Behnel's avatar Stefan Behnel

unpack FormattedValueNode with constant string value at compile time (unlikely...

unpack FormattedValueNode with constant string value at compile time (unlikely case but trivial to do...)
parent 5b182356
......@@ -3956,6 +3956,8 @@ class ConstantFolding(Visitor.VisitorTransform, SkipDeclarations):
self.visitchildren(node)
if isinstance(node.format_spec, ExprNodes.UnicodeNode) and not node.format_spec.value:
node.format_spec = None
if node.format_spec is None and node.conversion_char is None and isinstance(node.value, ExprNodes.UnicodeNode):
return node.value
return node
def visit_JoinedStrNode(self, node):
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment