Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Resolve #899 #932

Closed
wants to merge 1 commit into from
Closed
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 7 additions & 1 deletion sopel/modules/reload.py
Original file line number Diff line number Diff line change
Expand Up @@ -46,7 +46,13 @@ def f_reload(bot, trigger):

old_callables = {}
for obj_name, obj in iteritems(vars(old_module)):
bot.unregister(obj)
# This is a bit of a hacky fix, the problem is that the obj at this
# point could be any part of the module file, including an import
# or docstring or whatever. This just checks if obj is callable
# and then unregisters in that case. If it's not callable, we just
# ignore it. (Should be safe enough to ignore)
if callable(obj):
bot.unregister(obj)

# Also remove all references to sopel callables from top level of the
# module, so that they will not get loaded again if reloading the
Expand Down