Coverage for src/configuraptor/loaders/loaders_310.py: 0%

1"""

2 Loaders for Python 3.10.

3"""

4

5 import sys

6 from typing import BinaryIO

7

8 from ._types import T_config, as_tconfig

9

10 if sys.version_info > (3, 11):

11 raise EnvironmentError("Wrong Python version!")

12 else: # pragma: no cover

13 import tomlkit

14

15 def toml(f: BinaryIO) -> T_config:

16 """

17 Load a toml file.

18 """

19 data = tomlkit.load(f)

20 return as_tconfig(data)