[Python-Modernize] Replace im_self with __self__

This commit is contained in:
Calum Lind 2014-09-03 16:59:05 +01:00
parent fc7a136c70
commit 1ca08ccf95
2 changed files with 2 additions and 2 deletions

View File

@ -413,7 +413,7 @@ class RPCServer(component.Component):
"""
for key, value in self.factory.methods.items():
if value.im_self == obj:
if value.__self__ == obj:
del self.factory.methods[key]
def get_object_method(self, name):

View File

@ -127,7 +127,7 @@ class CustomNotifications(object):
log.error("The event \"%s\" is not known" % eventtype)
return False
if known_events[eventtype].__module__.startswith('deluge.event'):
if handler.im_self is self:
if handler.__self__ is self:
return True
log.error("You cannot register custom notification providers "
"for built-in event types.")