不典型的UnboundLocalError

时间:2015-06-16 19:43:31

标签: python django

这是代码:

def main(request):
    ..........
    div_list = soup.select('div')
    count = 0
    for div in div_list:
        count = count+1
    ..........

错误:

UnboundLocalError at /

local variable 'div_list' referenced before assignment

我无法理解它。我疯了吗?错误在哪里?

0 个答案:

没有答案