fix: Use files instead of open_binary

open_binary is deprecated

Co-authored-by: chayleaf <chayleaf@pavluk.org>
This commit is contained in:
Hendrik Wiese 2024-06-09 10:20:19 +02:00 committed by Hendrik Wiese
parent 5ea499430b
commit 61f528d9b3

View File

@ -27,7 +27,7 @@ def load() -> None:
global spdx_list global spdx_list
if spdx_list is not None: if spdx_list is not None:
return return
with resources.open_binary("maubot.cli", "res/spdx.json.zip") as disk_file: with resources.files("maubot.cli").joinpath("res/spdx.json.zip").open("rb") as disk_file:
with zipfile.ZipFile(disk_file) as zip_file: with zipfile.ZipFile(disk_file) as zip_file:
with zip_file.open("spdx.json") as file: with zip_file.open("spdx.json") as file:
spdx_list = json.load(file) spdx_list = json.load(file)