From 34d384bd679739578b5a34be3ef6fd67c8b03f21 Mon Sep 17 00:00:00 2001 From: Valentin Lorentz Date: Mon, 10 Aug 2015 18:09:52 +0200 Subject: [PATCH] Remove need for fix_methodattrs. --- plugins/Factoids/plugin.py | 2 +- setup.py | 2 +- src/callbacks.py | 6 +++--- 3 files changed, 5 insertions(+), 5 deletions(-) diff --git a/plugins/Factoids/plugin.py b/plugins/Factoids/plugin.py index 91aa5e214..388a3fe15 100644 --- a/plugins/Factoids/plugin.py +++ b/plugins/Factoids/plugin.py @@ -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] diff --git a/setup.py b/setup.py index 80cbf1b33..b1497588a 100644 --- a/setup.py +++ b/setup.py @@ -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)) diff --git a/src/callbacks.py b/src/callbacks.py index b5d5e02f6..1b35fec64 100644 --- a/src/callbacks.py +++ b/src/callbacks.py @@ -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: