MCPcopy Index your code
hub / github.com/msgspec/msgspec / _import_tomllib

Function _import_tomllib

src/msgspec/toml.py:25–43  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

23
24
25def _import_tomllib():
26 try:
27 import tomllib # type: ignore
28
29 return tomllib
30 except ImportError:
31 pass
32
33 try:
34 import tomli # type: ignore
35
36 return tomli
37 except ImportError:
38 raise ImportError(
39 "`msgspec.toml.decode` requires `tomli` be installed.\n\n"
40 "Please either `pip` or `conda` install it as follows:\n\n"
41 " $ python -m pip install tomli # using pip\n"
42 " $ conda install tomli # or using conda"
43 ) from None
44
45
46def _import_tomli_w():

Callers 1

decodeFunction · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…