From 8b7d16c8509edffa979fbf7a53f29cdca44d8aa3 Mon Sep 17 00:00:00 2001 From: Valentin Lorentz Date: Sat, 4 Aug 2012 18:46:16 +0200 Subject: [PATCH] Alias & RSS: Use types.MethodType instead of new.instancemethod. --- plugins/Alias/plugin.py | 4 ++-- plugins/RSS/plugin.py | 4 ++-- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/plugins/Alias/plugin.py b/plugins/Alias/plugin.py index e4a6b310f..e0cbc035c 100644 --- a/plugins/Alias/plugin.py +++ b/plugins/Alias/plugin.py @@ -29,7 +29,7 @@ ### import re -import new +import types import supybot.conf as conf import supybot.utils as utils @@ -264,7 +264,7 @@ class Alias(callbacks.Plugin): raise AliasError, format('Alias %q is locked.', name) try: f = makeNewAlias(name, alias) - f = new.instancemethod(f, self, Alias) + f = types.MethodType(f, self, Alias) except RecursiveAlias: raise AliasError, 'You can\'t define a recursive alias.' aliasGroup = self.registryValue('aliases', value=False) diff --git a/plugins/RSS/plugin.py b/plugins/RSS/plugin.py index 8d0332a7f..c43ed2fa3 100644 --- a/plugins/RSS/plugin.py +++ b/plugins/RSS/plugin.py @@ -28,8 +28,8 @@ # POSSIBILITY OF SUCH DAMAGE. ### -import new import time +import types import socket import sgmllib import threading @@ -349,7 +349,7 @@ class RSS(callbacks.Plugin): args.insert(0, url) self.rss(irc, msg, args) f = utils.python.changeFunctionName(f, name, docstring) - f = new.instancemethod(f, self, RSS) + f = types.MethodType(f, self, RSS) self.feedNames[name] = (url, f) self._registerFeed(name, url)