Skip to content

Commit

Permalink
bot: unregister plugin's URL callback with unregister_url_callback me…
Browse files Browse the repository at this point in the history
…thod
  • Loading branch information
Exirel committed Apr 12, 2019
1 parent 0f6ad54 commit 158b729
Showing 1 changed file with 5 additions and 4 deletions.
9 changes: 5 additions & 4 deletions sopel/bot.py
Original file line number Diff line number Diff line change
Expand Up @@ -279,10 +279,11 @@ def remove_plugin(self, plugin, callables, jobs, shutdowns, urls):
self.unregister(func)

# remove URL callback handlers
for func in urls:
regex = func.url_regex
if func == self.memory['url_callbacks'].get(regex):
del self.memory['url_callbacks'][regex]
if self.memory.contains('url_callbacks'):
for func in urls:
regex = func.url_regex
if func == self.memory['url_callbacks'].get(regex):
self.unregister_url_callback(regex)
except: # noqa
# TODO: consider logging?
raise # re-raised
Expand Down

0 comments on commit 158b729

Please sign in to comment.