Skip to content

Commit

Permalink
use sys.version check
Browse files Browse the repository at this point in the history
  • Loading branch information
hauntsaninja authored and FFY00 committed Apr 17, 2022
1 parent 9b21a48 commit 0b40b40
Showing 1 changed file with 4 additions and 4 deletions.
8 changes: 4 additions & 4 deletions src/build/__init__.py
Expand Up @@ -40,10 +40,10 @@
TOMLDecodeError: Type[Exception]
toml_loads: Callable[[str], MutableMapping[str, Any]]

try:
from tomllib import TOMLDecodeError # type: ignore
from tomllib import loads as toml_loads # type: ignore
except ModuleNotFoundError:
if sys.version_info >= (3, 11):
from tomllib import TOMLDecodeError
from tomllib import loads as toml_loads
else:
try:
from tomli import TOMLDecodeError
from tomli import loads as toml_loads
Expand Down

0 comments on commit 0b40b40

Please sign in to comment.