From 090e3f9a7454812a8b45280c9f482f01f9d6766a Mon Sep 17 00:00:00 2001 From: nexy7574 Date: Wed, 1 May 2024 01:23:41 +0100 Subject: [PATCH] Utilise built-in tomllib for better compatibility --- requirements.txt | 2 +- src/conf.py | 5 +++-- 2 files changed, 4 insertions(+), 3 deletions(-) diff --git a/requirements.txt b/requirements.txt index 0163e13..ea5ac2c 100644 --- a/requirements.txt +++ b/requirements.txt @@ -4,7 +4,7 @@ yt-dlp @ https://github.com/yt-dlp/yt-dlp/archive/master.tar.gz py-cord @ git+https://github.com/Pycord-Development/pycord.git httpx[http2]~=0.26 psycopg~=3.1 -toml~=0.10 +# toml~=0.10 pillow~=10.2 selenium~=4.16 rich~=13.7 diff --git a/src/conf.py b/src/conf.py index 111b67a..2a0ec68 100644 --- a/src/conf.py +++ b/src/conf.py @@ -3,7 +3,7 @@ import os import subprocess from pathlib import Path -import toml +import tomllib log = logging.getLogger("jimmy.autoconf") @@ -25,7 +25,8 @@ else: VERSION = "unknown" try: - CONFIG = toml.load("config.toml") + with open("config.toml", "rb") as file: + CONFIG = tomllib.load(file) except FileNotFoundError: cwd = Path.cwd() log.critical(