From 2aa1916d5c8e4832f26f6da4094238e9a0021d1c Mon Sep 17 00:00:00 2001 From: ToxicKidz Date: Thu, 13 May 2021 13:34:06 -0400 Subject: chore: Use pathlib.Path.read_text & write_text over open --- bot/exts/easter/egghead_quiz.py | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) (limited to 'bot/exts/easter/egghead_quiz.py') diff --git a/bot/exts/easter/egghead_quiz.py b/bot/exts/easter/egghead_quiz.py index b6b1593d..4b67310f 100644 --- a/bot/exts/easter/egghead_quiz.py +++ b/bot/exts/easter/egghead_quiz.py @@ -1,7 +1,7 @@ import asyncio import logging import random -from json import load +from json import loads from pathlib import Path from typing import Union @@ -13,8 +13,7 @@ from bot.constants import Colours log = logging.getLogger(__name__) -with open(Path("bot/resources/easter/egghead_questions.json"), "r", encoding="utf8") as f: - EGGHEAD_QUESTIONS = load(f) +EGGHEAD_QUESTIONS = loads(Path("bot/resources/easter/egghead_questions.json").read_text("utf8")) EMOJIS = [ -- cgit v1.2.3