Alias & RSS: Use types.MethodType instead of new.instancemethod.

This commit is contained in:
Valentin Lorentz 2012-08-04 18:46:16 +02:00
parent 7f0e1115b5
commit 8b7d16c850
2 changed files with 4 additions and 4 deletions

View File

@ -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)

View File

@ -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)