Ticket #1364: main.diff

File main.diff, 685 bytes (added by antony, 16 years ago)
  • .py

    old new  
    2020    # this stuff should be common to all reactors.
    2121    import twisted.internet
    2222    import sys
    23     assert not sys.modules.has_key('twisted.internet.reactor'), \
    24            "reactor already installed"
     23    if sys.modules.has_key('twisted.internet.reactor'):
     24        if twisted.internet.reactor != reactor:
     25            raise RuntimeError, "reactor already installed"
     26        else:
     27            # the same reactor is already installed, so do nothing
     28            return
    2529    twisted.internet.reactor = reactor
    2630    sys.modules['twisted.internet.reactor'] = reactor
    2731