Ticket #5789: userdict.patch.diff

File userdict.patch.diff, 1.9 KB (added by Pawel, 20 months ago)
  • twisted/manhole/explorer.py

    diff --git a/twisted/manhole/explorer.py b/twisted/manhole/explorer.py
    index b52693c..23bfd68 100644
    a b L{inspect} module available in Python 2.1. 
    1616
    1717# System Imports
    1818import inspect, string, sys, types
    19 import UserDict
    2019
    2120# Twisted Imports
    2221from twisted.spread import pb
    2322from twisted.python import reflect
    2423
    2524
    26 True=(1==1)
    27 False=not True
    28 
    29 class Pool(UserDict.UserDict):
     25class Pool(dict):
    3026    def getExplorer(self, object, identifier):
    3127        oid = id(object)
    32         if oid in self.data:
     28        if oid in self:
    3329            # XXX: This potentially returns something with
    3430            # 'identifier' set to a different value.
    35             return self.data[oid]
     31            return self[oid]
    3632        else:
    3733            klass = typeTable.get(type(object), ExplorerGeneric)
    3834            e = types.InstanceType(klass, {})
    39             self.data[oid] = e
     35            self[oid] = e
    4036            klass.__init__(e, object, identifier)
    4137            return e
    4238
  • twisted/protocols/postfix.py

    diff --git a/twisted/protocols/postfix.py b/twisted/protocols/postfix.py
    index 7a2079d..43797bf 100644
    a b Postfix mail transport agent related protocols. 
    77"""
    88
    99import sys
    10 import UserDict
    1110import urllib
    1211
    1312from twisted.protocols import basic
    class PostfixTCPMapServer(basic.LineReceiver, policies.TimeoutMixin): 
    9291                self.sendCode(500, 'put is not implemented yet.')
    9392
    9493
    95 class PostfixTCPMapDictServerFactory(protocol.ServerFactory,
    96                                      UserDict.UserDict):
     94class PostfixTCPMapDictServerFactory(protocol.ServerFactory, dict):
    9795    """An in-memory dictionary factory for PostfixTCPMapServer."""
    9896
    9997    protocol = PostfixTCPMapServer