MCPcopy Index your code
hub / github.com/RustPython/RustPython / _raise_malformed_node

Function _raise_malformed_node

Lib/ast.py:63–67  ·  view source on GitHub ↗
(node)

Source from the content-addressed store, hash-verified

61 if isinstance(node_or_string, Expression):
62 node_or_string = node_or_string.body
63 def _raise_malformed_node(node):
64 msg = "malformed node or string"
65 if lno := getattr(node, 'lineno', None):
66 msg += f' on line {lno}'
67 raise ValueError(msg + f': {node!r}')
68 def _convert_num(node):
69 if not isinstance(node, Constant) or type(node.value) not in (int, float, complex):
70 _raise_malformed_node(node)

Callers 2

_convert_numFunction · 0.85
_convertFunction · 0.85

Calls 1

getattrFunction · 0.85

Tested by

no test coverage detected