Pythonnonetype Object Is Not Subscriptable