class Solution:
def pathSum(self, root: TreeNode, targetSum: int) -> List[List[int]]:
ans = []
tmp = []
sum_node = 0
def dfs(node):
if not node:
return
sum_node += node.val
tmp.append(node.val)
if sum_node == targetSum and not node.left and not node.right:
ans.append(tmp[:])
dfs(node.left)
dfs(node.right)
sum_node -= tmp.pop()
dfs(root)
return ans
It's my solution of leetcode 113. Why it shows 'UnboundedLocalError: local variable 'sum_node' referenced before assignment'?