mirror of
https://github.com/python-kasa/python-kasa.git
synced 2024-12-22 11:13:34 +00:00
2d42ca301f
* Use orjson when already installed * Use orjson when already installed * fix patch target * fix patch target * add speedups extra * Update README.md * Update README.md
16 lines
262 B
Python
Executable File
16 lines
262 B
Python
Executable File
"""JSON abstraction."""
|
|
|
|
try:
|
|
import orjson
|
|
|
|
def dumps(obj, *, default=None):
|
|
"""Dump JSON."""
|
|
return orjson.dumps(obj).decode()
|
|
|
|
loads = orjson.loads
|
|
except ImportError:
|
|
import json
|
|
|
|
dumps = json.dumps
|
|
loads = json.loads
|