Skip to content

Commit

Permalink
fix: Fix building value for joined strings
Browse files Browse the repository at this point in the history
  • Loading branch information
pawamoy committed Jan 2, 2022
1 parent 48062ac commit 6154b69
Showing 1 changed file with 8 additions and 1 deletion.
9 changes: 8 additions & 1 deletion src/griffe/agents/nodes.py
Original file line number Diff line number Diff line change
Expand Up @@ -775,6 +775,10 @@ def _get_constant_value(node: NodeConstant) -> str:
return repr(node.value)


def _get_constant_value_no_repr(node: NodeConstant) -> str:
return node.value


def _get_dict_value(node: NodeDict) -> str:
pairs = zip(node.keys, node.values)
gen = (f"{'None' if key is None else get_value(key)}: {get_value(value)}" for key, value in pairs) # noqa: WPS509
Expand Down Expand Up @@ -843,7 +847,10 @@ def _get_isnot_value(node: NodeIsNot) -> str:


def _get_joinedstr_value(node: NodeJoinedStr) -> str:
return "".join(get_value(value) for value in node.values)
_node_value_map[NodeConstant] = _get_constant_value_no_repr
result = repr("".join(get_value(value) for value in node.values))
_node_value_map[NodeConstant] = _get_constant_value
return result


def _get_keyword_value(node: NodeKeyword) -> str:
Expand Down

0 comments on commit 6154b69

Please sign in to comment.