Remove need for fix_methodattrs.

This commit is contained in:
Valentin Lorentz 2015-08-10 18:09:52 +02:00
parent c0ac84bb53
commit 34d384bd67
3 changed files with 5 additions and 5 deletions

View File

@ -248,7 +248,7 @@ class Factoids(callbacks.Plugin, plugins.ChannelDBHandler):
def getCommandHelp(self, command, simpleSyntax=None):
method = self.getCommandMethod(command)
if method.im_func.__name__ == 'learn':
if method.__func__.__name__ == 'learn':
chan = None
if dynamic.msg is not None:
chan = dynamic.msg.args[0]

View File

@ -158,7 +158,7 @@ try:
log.debug(msg, *args)
fixer_names = ['fix_basestring',
'fix_metaclass', 'fix_methodattrs',
'fix_metaclass',
'fix_numliterals',
'fix_unicode', 'fix_xrange']
fixers = list(map(lambda x:'lib2to3.fixes.'+x, fixer_names))

View File

@ -1021,7 +1021,7 @@ class CommandThread(world.SupyThread):
"""
def __init__(self, target=None, args=(), kwargs={}):
self.command = args[0]
self.cb = target.im_self
self.cb = target.__self__
threadName = 'Thread #%s (for %s.%s)' % (world.threadsSpawned,
self.cb.name(),
self.command)
@ -1175,7 +1175,7 @@ class Commands(BasePlugin):
if hasattr(self, name):
method = getattr(self, name)
if inspect.ismethod(method):
code = method.im_func.__code__
code = method.__func__.__code__
return inspect.getargs(code)[0] == self.commandArgs
else:
return False
@ -1222,7 +1222,7 @@ class Commands(BasePlugin):
else:
method = getattr(self, command[0])
if inspect.ismethod(method):
code = method.im_func.__code__
code = method.__func__.__code__
if inspect.getargs(code)[0] == self.commandArgs:
return method
else: