NodeGraphQt
NodeGraphQt copied to clipboard
Dictionary iteration error when dealing with subgraphs
Hello,
I found an issue with expanding graphs:
https://github.com/jchanvfx/NodeGraphQt/blob/a8fa9b394d35bf4fcad3c241ec1bd7a98b40bb1c/NodeGraphQt/base/graph.py#L2958
At this line 👆 you iterate though the items of an internal dict. A few lines lower, within the iteration there is this call: 👇
https://github.com/jchanvfx/NodeGraphQt/blob/a8fa9b394d35bf4fcad3c241ec1bd7a98b40bb1c/NodeGraphQt/base/graph.py#L2962
However, the function called from there 👆 is modifying the same internal dict 👇
https://github.com/jchanvfx/NodeGraphQt/blob/a8fa9b394d35bf4fcad3c241ec1bd7a98b40bb1c/NodeGraphQt/base/graph.py#L2997
As a result, it raises RuntimeError: dictionary changed size during iteration
This is likely a result of a Python2 to Python3 change, where the result of dict.items() changed from a list to an iterator.