Skip to content

Commit e7d4aed

Browse files
committed
style(typing): conditionally import toml lib per Python version
1 parent 207249b commit e7d4aed

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

cpp_linter_hooks/util.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -5,9 +5,9 @@
55
import logging
66
from typing import Optional, List
77

8-
try:
8+
if sys.version_info >= (3, 11):
99
import tomllib
10-
except ModuleNotFoundError:
10+
else:
1111
import tomli as tomllib
1212

1313
from cpp_linter_hooks.versions import CLANG_FORMAT_VERSIONS, CLANG_TIDY_VERSIONS

0 commit comments

Comments
 (0)