Skip to content

Commit

Permalink
plugins.handlers: execute py2 TODO (remove deprecated imp import)
Browse files Browse the repository at this point in the history
  • Loading branch information
dgw committed Dec 2, 2021
1 parent 9af117a commit fb237a5
Showing 1 changed file with 1 addition and 9 deletions.
10 changes: 1 addition & 9 deletions sopel/plugins/handlers.py
Original file line number Diff line number Diff line change
Expand Up @@ -44,7 +44,6 @@
from __future__ import generator_stop

import abc
import imp
import importlib
import inspect
import itertools
Expand All @@ -53,13 +52,6 @@
from sopel import loader
from . import exceptions

try:
reload = importlib.reload
except AttributeError:
# py2: no reload function
# TODO: imp is deprecated, to be removed when py2 support is dropped
reload = imp.reload


class AbstractPluginHandler(abc.ABC):
"""Base class for plugin handlers.
Expand Down Expand Up @@ -303,7 +295,7 @@ def reload(self):
This method assumes the plugin is already loaded.
"""
self._module = reload(self._module)
self._module = importlib.reload(self._module)

def is_loaded(self):
return self._module is not None
Expand Down

0 comments on commit fb237a5

Please sign in to comment.