mirror of https://github.com/MISP/PyMISP
chg: [internal] User faster method to convert bytes to str
parent
85ac94cc1c
commit
8c23a2def7
|
@ -247,8 +247,9 @@ class AbstractMISP(MutableMapping, MISPFileCache, metaclass=ABCMeta):
|
|||
option |= orjson.OPT_SORT_KEYS
|
||||
if indent:
|
||||
option |= orjson.OPT_INDENT_2
|
||||
|
||||
return dumps(self, default=pymisp_json_default, option=option).decode("utf-8")
|
||||
# orjson dumps method returns bytes instead of bytes, to keep compatibility with json
|
||||
# we have to convert output to str
|
||||
return str(dumps(self, default=pymisp_json_default, option=option))
|
||||
|
||||
return dumps(self, default=pymisp_json_default, sort_keys=sort_keys, indent=indent)
|
||||
|
||||
|
|
Loading…
Reference in New Issue