From e4f0e88a5887f47070cf7a19fc240df3beaff25a Mon Sep 17 00:00:00 2001 From: dymik739 Date: Thu, 4 May 2023 18:13:08 +0300 Subject: [PATCH] main.py: replace deprecated imp module with importlib --- main.py | 3 +-- module-testing.py | 3 +-- 2 files changed, 2 insertions(+), 4 deletions(-) diff --git a/main.py b/main.py index ee96b64..84f6d20 100644 --- a/main.py +++ b/main.py @@ -7,7 +7,6 @@ import sys import os import threading import importlib -import imp # global variables STOP_REQUESTED = False @@ -177,7 +176,7 @@ def queue_processor(): # properly reload all v2 modules for mod in mcu.modules: if mod.version == 2: - imp.reload(mod.obj) + importlib.reload(mod.obj) del mcu.modules[:] mcu.reload_modules() diff --git a/module-testing.py b/module-testing.py index d333df9..e31018f 100644 --- a/module-testing.py +++ b/module-testing.py @@ -6,7 +6,6 @@ import sys import os import threading import importlib -import imp from telegram import Message, Chat @@ -180,7 +179,7 @@ def queue_processor(): # properly reload all v2 modules for mod in mcu.modules: if mod.version == 2: - imp.reload(mod.obj) + importlib.reload(mod.obj) del mcu.modules[:] mcu.reload_modules()