From 272454c2cec5b32375c749c85471274e681d024f Mon Sep 17 00:00:00 2001 From: KnugiHK <24708955+KnugiHK@users.noreply.github.com> Date: Sat, 1 Mar 2025 23:59:12 +0800 Subject: [PATCH] Bug fix on missing `_version_` variable, introduced in 0.11.0 --- Whatsapp_Chat_Exporter/utility.py | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/Whatsapp_Chat_Exporter/utility.py b/Whatsapp_Chat_Exporter/utility.py index f51f21d..d009a4a 100644 --- a/Whatsapp_Chat_Exporter/utility.py +++ b/Whatsapp_Chat_Exporter/utility.py @@ -96,8 +96,8 @@ def determine_day(last, current): def check_update(): import urllib.request import json + import importlib from sys import platform - from .__init__ import __version__ package_url_json = "https://pypi.org/pypi/whatsapp-chat-exporter/json" try: @@ -109,6 +109,7 @@ def check_update(): with raw: package_info = json.load(raw) latest_version = tuple(map(int, package_info["info"]["version"].split("."))) + __version__ = importlib.metadata.version("whatsapp_chat_exporter") current_version = tuple(map(int, __version__.split("."))) if current_version < latest_version: print("===============Update===============")