Skip to content

Commit fb237a5

Browse files
committed
plugins.handlers: execute py2 TODO (remove deprecated imp import)
1 parent 9af117a commit fb237a5

File tree

1 file changed

+1
-9
lines changed

1 file changed

+1
-9
lines changed

sopel/plugins/handlers.py

Lines changed: 1 addition & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -44,7 +44,6 @@
4444
from __future__ import generator_stop
4545

4646
import abc
47-
import imp
4847
import importlib
4948
import inspect
5049
import itertools
@@ -53,13 +52,6 @@
5352
from sopel import loader
5453
from . import exceptions
5554

56-
try:
57-
reload = importlib.reload
58-
except AttributeError:
59-
# py2: no reload function
60-
# TODO: imp is deprecated, to be removed when py2 support is dropped
61-
reload = imp.reload
62-
6355

6456
class AbstractPluginHandler(abc.ABC):
6557
"""Base class for plugin handlers.
@@ -303,7 +295,7 @@ def reload(self):
303295
304296
This method assumes the plugin is already loaded.
305297
"""
306-
self._module = reload(self._module)
298+
self._module = importlib.reload(self._module)
307299

308300
def is_loaded(self):
309301
return self._module is not None

0 commit comments

Comments
 (0)