Add handling for memoryview (#6987)

This commit is contained in:
Ville Brofeldt 2019-03-15 07:35:40 +02:00 committed by Maxime Beauchemin
parent 4ca2cc1ef2
commit 5e66008ba1
1 changed files with 2 additions and 0 deletions

View File

@ -340,6 +340,8 @@ def base_json_conv(obj):
return str(obj)
elif isinstance(obj, timedelta):
return str(obj)
elif isinstance(obj, memoryview):
return str(obj.tobytes(), 'utf8')
elif isinstance(obj, bytes):
try:
return '{}'.format(obj)