From fd6622b872fce1300d0d2043d3ed3bba15c7759c Mon Sep 17 00:00:00 2001 From: kongr45gpen Date: Mon, 31 May 2021 03:28:20 +0300 Subject: Fix reloads on pythonv3 --- __init__.py | 2 +- plugin.py | 7 +++---- 2 files changed, 4 insertions(+), 5 deletions(-) diff --git a/__init__.py b/__init__.py index 97f40ae..107636d 100644 --- a/__init__.py +++ b/__init__.py @@ -25,7 +25,7 @@ __url__ = 'https://github.com/kongr45gpen/supybot-github' from . import config from . import plugin -from imp import reload +from importlib import reload reload(plugin) # In case we're being reloaded. # Add more reloads here if you add third-party modules and want them to be # reloaded when this plugin is reloaded. Don't forget to import them as well! diff --git a/plugin.py b/plugin.py index e5010c9..a93de96 100644 --- a/plugin.py +++ b/plugin.py @@ -50,10 +50,9 @@ from .local import globals from .local.handler import GithubHandler as RequestHandler from .local import utility as Utility -from imp import reload - globals.init() +import importlib class Github(callbacks.Plugin): """Add the help for \"@plugin help Github\" here @@ -95,8 +94,8 @@ class Github(callbacks.Plugin): self.httpd.server_close() self.httpd.shutdown() self.__parent.die() - reload(RequestHandler) - reload(Utility) + importlib.reload(RequestHandler) + importlib.reload(Utility) def get(self, irc, msg, args, order, type, garbage): """[] [] [] -- cgit v1.2.3