Ticket #125: foolscap_misc_fixes.diff

File foolscap_misc_fixes.diff, 1.6 KB (added by sp, 13 years ago)

Fixes for both the log.logerr bug and a deprecation warning in banana.py

  • foolscap/banana.py

    # HG changeset patch
    # User Stephan Peijnik <spe@anexia.at>
    # Date 1292664864 -3600
    # Node ID 5fe8aeb4c03ac3478a3749eebc7762542223758f
    # Parent  dc4e1cfd901f07957c48f141c95d398c88d1f9e3
    foolscap/call.py:
     - Replaced non-existant foolscap.logging.log with twisted.python.log
       (Closes: #125).
    
    foolscap/banana.py:
     - Fixed deprecation warning for sets module, sets.Set was replaced
       with builtin 'set'. Still uses old behvaiour for python < 2.6.
    
    Signed-off-by: Stephan Peijnik <spe@anexia.at>
    
    diff -r dc4e1cfd901f -r 5fe8aeb4c03a foolscap/banana.py
    a b  
    11
    2 import struct, sets, time
     2import sys
     3
     4if sys.version_info[0] >= 2 and sys.version_info[1] >= 6:
     5    class sets:
     6        Set = set
     7else:
     8    import sets
     9
     10import struct, time
    311
    412from twisted.internet import protocol, defer, reactor
    513from twisted.python.failure import Failure
  • foolscap/call.py

    diff -r dc4e1cfd901f -r 5fe8aeb4c03a foolscap/call.py
    a b  
    11
    2 from twisted.python import failure, reflect
     2from twisted.python import failure, reflect, log as twlog
    33from twisted.internet import defer
    44
    55from foolscap import copyable, slicer, tokens
     
    913913    pickled = 1
    914914    def printTraceback(self, file=None, elideFrameworkCode=0,
    915915                       detail='default'):
    916         if file is None: file = log.logerr
     916        if file is None: file = twlog.logerr
    917917        file.write("Traceback from remote host -- ")
    918918        file.write(self.traceback)
    919919