Update todolist.py

Hotfix: Prevent the "referenced before assignment" in EmptyPage exceptions.