full_text_mroonga_catalog: fix a PY3 regression
from 031408c6 (erp5_full_text_mroonga_catalog: defer fulltext index and unindex using dedicated catalog keys., 2025-01-13)
Showing
-
Owner
How about the following ?
@@ -1,8 +1,8 @@ uid_list = [] for grouped_message in grouped_message_list: assert not grouped_message.args - assert grouped_message.kw.keys() == ['uid'] - uid_list.append(grouped_message.kw['uid']) + uid_list.append(grouped_message.kw.pop('uid')) + assert not grouped_message.kw for method_id in context.getSqlDeferredUncatalogObjectList(): method = getattr(context, method_id) method(uid=uid_list)
-
Owner
Thanks, but is it "safe" to mutate this dict like this ?
-
Owner
I believe it's safe, unless we use the dict in the code below of the same script.
-
Owner
Or... I can propose the following, if you prefer.
assert len(grouped_message.kw) == 1 uid_list.append(grouped_message.kw['uid'])
-
Owner
ah sorry, I forgot to reply. I was a bit worried about not only using the dict in the same script, but also from the functions calling the script. I really like what you just suggested.
Please register or sign in to comment