diff options
Diffstat (limited to 'coverage/tomlconfig.py')
| -rw-r--r-- | coverage/tomlconfig.py | 9 | 
1 files changed, 5 insertions, 4 deletions
diff --git a/coverage/tomlconfig.py b/coverage/tomlconfig.py index 82f84ce9..b04d66e2 100644 --- a/coverage/tomlconfig.py +++ b/coverage/tomlconfig.py @@ -6,20 +6,21 @@  import configparser  import os  import re -import sys +from coverage import env  from coverage.exceptions import ConfigError  from coverage.misc import import_third_party, substitute_variables -if sys.version_info >= (3, 11): -    import tomllib + +if env.PYVERSION >= (3, 11): +    import tomllib      # pylint: disable=import-error  else:      # TOML support on Python 3.10 and below is an install-time extra option.      # (Import typing is here because import_third_party will unload any module      # that wasn't already imported. tomli imports typing, and if we unload it,      # later it's imported again, and on Python 3.6, this causes infinite      # recursion.) -    import typing   # pylint: disable=unused-import, wrong-import-order +    import typing   # pylint: disable=unused-import      tomllib = import_third_party("tomli")  | 
