Add some hacky debugging aid for when a User lingers around
This commit is contained in:
parent
8f38900a44
commit
5842b41097
10
src/users.py
10
src/users.py
@ -73,6 +73,16 @@ def _get(nick=None, ident=None, host=None, realname=None, account=None, *, allow
|
||||
return potential[0]
|
||||
|
||||
if len(potential) > 1:
|
||||
# XXX Debugging aid for when this fails (and we can't figure out why)
|
||||
import gc
|
||||
all_refs = []
|
||||
for user in potential:
|
||||
for ref in gc.get_referrers(user):
|
||||
for name, thing in var.__dict__.items():
|
||||
if ref is thing: # Found it!
|
||||
all_refs.append((user, name))
|
||||
break
|
||||
|
||||
raise ValueError("More than one user matches: " +
|
||||
_arg_msg.format(nick, ident, host, realname, account, allow_bot))
|
||||
|
||||
|
Loading…
x
Reference in New Issue
Block a user