()
| 23 | |
| 24 | |
| 25 | def _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 | |
| 46 | def _import_tomli_w(): |
no outgoing calls
no test coverage detected
searching dependent graphs…