mirror of
https://github.com/Mikaela/Limnoria.git
synced 2024-11-23 19:19:32 +01:00
Made CommandThread work with non-instancemethods.
This commit is contained in:
parent
e30cf69ec1
commit
5630782e85
@ -342,8 +342,14 @@ class CommandThread(threading.Thread):
|
||||
def __init__(self, command, irc, msg, args):
|
||||
self.command = command
|
||||
world.threadsSpawned += 1
|
||||
self.commandName = command.im_func.func_name
|
||||
self.className = command.im_class.__name__
|
||||
try:
|
||||
self.commandName = command.im_func.func_name
|
||||
except AttributeError:
|
||||
self.commandName = command.__name__
|
||||
try:
|
||||
self.className = command.im_class.__name__
|
||||
except AttributeError:
|
||||
self.className = '<unknown>'
|
||||
name = '%s.%s with args %r' % (self.className, self.commandName, args)
|
||||
threading.Thread.__init__(self, target=command, name=name,
|
||||
args=(irc, msg, args))
|
||||
|
Loading…
Reference in New Issue
Block a user