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
|
option |= orjson.OPT_SORT_KEYS
|
||||||
if indent:
|
if indent:
|
||||||
option |= orjson.OPT_INDENT_2
|
option |= orjson.OPT_INDENT_2
|
||||||
|
# orjson dumps method returns bytes instead of bytes, to keep compatibility with json
|
||||||
return dumps(self, default=pymisp_json_default, option=option).decode("utf-8")
|
# 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)
|
return dumps(self, default=pymisp_json_default, sort_keys=sort_keys, indent=indent)
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue