From d0f4bd7d1e02ba866189ce5020804c1fa1401741 Mon Sep 17 00:00:00 2001 From: Andrew Hamilton Date: Mon, 2 Jun 2025 18:58:45 +1000 Subject: [PATCH] Use tomllib now that toml is in the standard library --- eris/eris/tools.py | 8 ++++---- eris/pyproject.toml | 3 +-- 2 files changed, 5 insertions(+), 6 deletions(-) diff --git a/eris/eris/tools.py b/eris/eris/tools.py index 9d90ae8..08a3be4 100755 --- a/eris/eris/tools.py +++ b/eris/eris/tools.py @@ -30,7 +30,7 @@ import pygments import pygments.lexers import pygments.styles import termstr -import toml +import tomllib import eris @@ -456,10 +456,10 @@ elinks, git_diff, git_blame = None, None, None # For linters. if "ERIS_CONFIG" in os.environ: - tools_toml = toml.load(os.environ["ERIS_CONFIG"]) + tools_toml = tomllib.load(open(os.environ["ERIS_CONFIG"], "rb")) else: - with importlib.resources.open_text(eris, "tools.toml") as tools_toml_file: - tools_toml = toml.load(tools_toml_file) + with importlib.resources.open_binary(eris, "tools.toml") as tools_toml_file: + tools_toml = tomllib.load(tools_toml_file) tools_for_extensions = tools_toml["tools_for_extensions"] del tools_toml["tools_for_extensions"] for tool_name, tool_toml in tools_toml.items(): diff --git a/eris/pyproject.toml b/eris/pyproject.toml index c52ba31..24e2cff 100644 --- a/eris/pyproject.toml +++ b/eris/pyproject.toml @@ -18,8 +18,7 @@ dependencies = [ "pillow==11.2.1", "pygments==2.19.1", "pyinotify-elephant-fork==0.0.1", - "termstr @ git+https://gitlab.com/ahamilton/eris@v2024.12.18#subdirectory=termstr", - "toml==0.10.2", + "termstr @ git+https://gitlab.com/ahamilton/eris@v2024.12.18#subdirectory=termstr" ] [project.scripts]