8000 Fix store of answers on Python3.6 (DictProxy) by pirat89 · Pull Request #759 · oamg/leapp · GitHub
[go: up one dir, main page]
More Web Proxy on the site http://driver.im/
Skip to content

Fix store of answers on Python3.6 (DictProxy) #759

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Closed
wants to merge 1 commit into from
Closed
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
7 changes: 6 additions & 1 deletion leapp/messaging/answerstore.py
Original file line number Diff line number Diff line change
Expand Up @@ -118,7 +118,12 @@ def get(self, scope, fallback=None):
:return:
"""
answer = self._storage.get(scope, fallback)
create_audit_entry('dialog-answer', {'scope': scope, 'fallback': fallback, 'answer': answer})
try:
create_audit_entry('dialog-answer', {'scope': scope, 'fallback': fallback, 'answer': answer})
except TypeError:
# On Python3, the answer is "sometimes" DictProxy which is not JSON serialisable.
# Creating the shallow copy in such a case should be ok. This is happ
create_audit_entry('dialog-answer', {'scope': scope, 'fallback': fallback, 'answer': answer.copy()})
return answer

def translate_for_workflow(self, workflow):
Expand Down
0