view roundup/anypy/sets_.py @ 4215:57dfcc824acc

fix problem with bounce-message if incoming mail has insufficient privilege... ...e.g., user not existing (issue 2550534) Added a regression test for this issue that reproduces the traceback reported in issue 2550534 I'm using a slightly modified variant of the original patch that avoids repeated string-concatenation (which could degenerate to quadratic runtime behaviour for large number of email headers).
author Ralf Schlatterbeck <schlatterbeck@users.sourceforge.net>
date Wed, 15 Jul 2009 12:22:35 +0000
parents eddb82d0964c
children 06af6d5bedbe
line wrap: on
line source

"""
anypy.sets_: sets compatibility module

uses the built-in type 'set' if available, and thus avoids
deprecation warnings. Simple usage:

Change all
    from sets import Set
to
    from roundup.anypy.sets_ import set

and use 'set' instead of 'Set'.
To avoid unnecessary imports, you can:

    try:
        set
    except NameError:
        from roundup.anypy.sets_ import set

see:
http://docs.python.org/library/sets.html#comparison-to-the-built-in-set-types

"""

try:
    set = set                     # built-in since Python 2.4
except NameError, TypeError:
    from sets import Set as set   # deprecated as of Python 2.6

# vim: ts=8 sts=4 sw=4 si et

Roundup Issue Tracker: http://roundup-tracker.org/