MCPcopy
hub / github.com/msgspec/msgspec / _import_pyyaml

Function _import_pyyaml

src/msgspec/yaml.py:25–36  ·  view source on GitHub ↗
(name)

Source from the content-addressed store, hash-verified

23
24
25def _import_pyyaml(name):
26 try:
27 import yaml # type: ignore
28 except ImportError:
29 raise ImportError(
30 f"`msgspec.yaml.{name}` requires PyYAML be installed.\n\n"
31 "Please either `pip` or `conda` install it as follows:\n\n"
32 " $ python -m pip install pyyaml # using pip\n"
33 " $ conda install pyyaml # or using conda"
34 ) from None
35 else:
36 return yaml
37
38
39def encode(

Callers 2

encodeFunction · 0.85
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…