Line | |
---|
1 | """ |
---|
2 | Unified entry point for CBOR encoding and decoding. |
---|
3 | |
---|
4 | Makes it less likely to use ``cbor2.loads()`` by mistake, which we want to avoid. |
---|
5 | """ |
---|
6 | |
---|
7 | # We don't want to use the C extension for loading, at least for now, but using |
---|
8 | # it for dumping should be fine. |
---|
9 | from cbor2 import dumps, dump |
---|
10 | |
---|
11 | def load(*args, **kwargs): |
---|
12 | """ |
---|
13 | Don't use this! Here just in case someone uses it by mistake. |
---|
14 | """ |
---|
15 | raise RuntimeError("Use pycddl for decoding CBOR") |
---|
16 | |
---|
17 | loads = load |
---|
18 | |
---|
19 | __all__ = ["dumps", "loads", "dump", "load"] |
---|
Note: See
TracBrowser
for help on using the repository browser.