chore: use tomllib on Python 3.11 (#1047)

* Use tomllib on Python 3.11

* delint

Co-authored-by: hauntsaninja <>
This commit is contained in:
Shantanu
2022-04-16 00:00:57 -04:00
committed by GitHub
co-authored by hauntsaninja <>
parent 9ae6ae2756
commit 6d4431306e
8 changed files with 48 additions and 16 deletions
+8 -2
View File
@@ -5,13 +5,19 @@ from __future__ import annotations
import copy
import difflib
import logging
import sys
from pathlib import Path
from typing import Any, Union
import click
import requests
import rich
import tomli
if sys.version_info >= (3, 11):
import tomllib
else:
import tomli as tomllib
from packaging.specifiers import Specifier
from packaging.version import Version
from rich.logging import RichHandler
@@ -296,7 +302,7 @@ def update_pythons(force: bool, level: str) -> None:
original_toml = toml_file_path.read_text()
with toml_file_path.open("rb") as f:
configs = tomli.load(f)
configs = tomllib.load(f)
for config in configs["windows"]["python_configurations"]:
all_versions.update_config(config)