UnboundLocalError: local variable 'sessions_temp' referenced before assignment #2
Labels
No labels
bug
duplicate
enhancement
help wanted
invalid
question
wontfix
No milestone
No project
No assignees
1 participant
Notifications
Due date
No due date set.
Dependencies
No dependencies set.
Reference: spla/xmppbot.py#2
Loading…
Reference in a new issue
No description provided.
Delete branch "%!s()"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
The code throws this error after demanding "sessions" to the bot:
Traceback (most recent call last):
File "xmpp.py", line 104, in
sessions = ejabberd.user_sessions_info(mention.acct, bot.mastodon_hostname)
File "/home/mastodon/bots/xmppbot/ejabberdapi.py", line 213, in user_sessions_info
sessions = self.__json_allow_dict_attrs(sessions_temp)
UnboundLocalError: local variable 'sessions_temp' referenced before assignment
If there is not any active session, the response of the Ejabberd API is []:
(Pdb) response.json()
[]
so sessions_temp is not referenced.