You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
>>> from staticfg import CFGBuilder
>>> cfg = CFGBuilder().build_from_file('blah.py', './blah.py')
The CFGBuilder crashes if func_name is None.
File "/opt/homebrew/lib/python3.12/site-packages/staticfg/builder.py", line 275, in visit_Call
func_name = visit_func(func)
^^^^^^^^^^^^^^^^
File "/opt/homebrew/lib/python3.12/site-packages/staticfg/builder.py", line 267, in visit_func
func_name += "." + node.attr
TypeError: unsupported operand type(s) for +=: 'NoneType' and 'str'
The relevant code:
defvisit_Call(self, node):
defvisit_func(node):
iftype(node) ==ast.Name:
returnnode.ideliftype(node) ==ast.Attribute:
# Recursion on series of calls to attributes.func_name=visit_func(node.value)
func_name+="."+node.attrreturnfunc_name
I can work around this like so:
elif type(node) ==ast.Attribute:
# Recursion on series of calls to attributes.func_name=visit_func(node.value)
iffunc_nameisNone:
func_name=""func_name+="."+node.attrreturnfunc_name
but that might just be masking the problem.
The text was updated successfully, but these errors were encountered:
Description
When running code like so:
The CFGBuilder crashes if
func_name
isNone
.The relevant code:
I can work around this like so:
but that might just be masking the problem.
The text was updated successfully, but these errors were encountered: