mirror of
https://github.com/ansible-collections/community.general.git
synced 2026-05-07 05:42:50 +00:00
Fix undefined variables, basestring usage, and some associated python3 issues
This commit is contained in:
@@ -85,7 +85,8 @@ class UnsafeProxy(object):
|
||||
class AnsibleJSONUnsafeEncoder(json.JSONEncoder):
|
||||
def encode(self, obj):
|
||||
if isinstance(obj, AnsibleUnsafe):
|
||||
return super(AnsibleJSONUnsafeEncoder, self).encode(dict(__ansible_unsafe=True, value=unicode(obj)))
|
||||
return super(AnsibleJSONUnsafeEncoder, self).encode(dict(__ansible_unsafe=True,
|
||||
value=to_text(obj, errors='surrogate_or_strict', nonstring='strict')))
|
||||
else:
|
||||
return super(AnsibleJSONUnsafeEncoder, self).encode(obj)
|
||||
|
||||
|
||||
Reference in New Issue
Block a user