UnboundLocalError: local variable 'sessions_temp' referenced before assignment #2

Tancada
oberta 2022-08-19 08:49:49 +02:00 per spla · 1 comment
spla ha comentat 2022-08-19 08:49:49 +02:00 (Migrado desde codeberg.org)

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

The code throws this error after demanding "sessions" to the bot: Traceback (most recent call last): File "xmpp.py", line 104, in <module> 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
spla ha comentat 2022-08-19 09:23:40 +02:00 (Migrado desde codeberg.org)

If there is not any active session, the response of the Ejabberd API is []:

(Pdb) response.json()
[]

so sessions_temp is not referenced.

If there is not any active session, the response of the Ejabberd API is []: (Pdb) response.json() [] so sessions_temp is not referenced.
Inicia sessió per a unir-te a aquesta conversa.
Sense Milestone
Ningún proyecto
Sense assignats
1 participant
Notificacions
Data de venciment
La fecha de vencimiento es inválida o está fuera de rango. Por favor utilice el formato 'aaaa-mm-dd'.

Sin fecha de vencimiento.

Dependències

Aquesta incidència no té cap dependència.

Referència: spla/xmppbot.py#2
Aún no existe contenido.