
from circuit.breaker import CircuitBreaker, CircuitBreakerSet
try:
    from twisted.internet import defer
except ImportError:
    pass


class TwistedCircuitBreaker(CircuitBreaker):
    """Circuit breaker that know that L{defer.inlineCallbacks} use
    exceptions in its internal workings.
    """

    def __exit__(self, exc_type, exc_val, tb):
        print "EXIT"
        if exc_type is defer._DefGen_Return:
            print "GOT IT"
            exc_type, exc_val, tb = None, None, None
        return CircuitBreaker.__exit__(self, exc_type, exc_val, tb)


class TwistedCircuitBreakerSet(CircuitBreakerSet):
    """Circuit breaker that supports twisted."""

    def __init__(self, reactor, logger, **kwargs):
        kwargs.update({'factory': TwistedCircuitBreaker})
        CircuitBreakerSet.__init__(self, reactor.seconds, logger,
            **kwargs)


from circuit.breaker import CircuitBreaker, CircuitBreakerSet
try:
    from twisted.internet import defer
except ImportError:
    pass


class TwistedCircuitBreaker(CircuitBreaker):
    """Circuit breaker that know that L{defer.inlineCallbacks} use
    exceptions in its internal workings.
    """

    def __exit__(self, exc_type, exc_val, tb):
        if exc_type is defer._DefGen_Return:
            exc_type, exc_val, tb = None, None, None
        return CircuitBreaker.__exit__(self, exc_type, exc_val, tb)


class TwistedCircuitBreakerSet(CircuitBreakerSet):
    """Circuit breaker that supports twisted."""

    def __init__(self, reactor, logger, **kwargs):
        kwargs.update({'factory': TwistedCircuitBreaker})
        CircuitBreakerSet.__init__(self, reactor.seconds, logger,
            **kwargs)

Remove print statements from TwistedCircuitBreaker
Remove print statements from TwistedCircuitBreaker
  
  from circuit.breaker import CircuitBreaker, CircuitBreakerSet
  try:
      from twisted.internet import defer
  except ImportError:
      pass
  
  
  class TwistedCircuitBreaker(CircuitBreaker):
      """Circuit breaker that know that L{defer.inlineCallbacks} use
      exceptions in its internal workings.
      """
  
      def __exit__(self, exc_type, exc_val, tb):
-         print "EXIT"
          if exc_type is defer._DefGen_Return:
-             print "GOT IT"
              exc_type, exc_val, tb = None, None, None
          return CircuitBreaker.__exit__(self, exc_type, exc_val, tb)
  
  
  class TwistedCircuitBreakerSet(CircuitBreakerSet):
      """Circuit breaker that supports twisted."""
  
      def __init__(self, reactor, logger, **kwargs):
          kwargs.update({'factory': TwistedCircuitBreaker})
          CircuitBreakerSet.__init__(self, reactor.seconds, logger,
              **kwargs)
  
Remove print statements from TwistedCircuitBreaker
## Code Before:

from circuit.breaker import CircuitBreaker, CircuitBreakerSet
try:
    from twisted.internet import defer
except ImportError:
    pass


class TwistedCircuitBreaker(CircuitBreaker):
    """Circuit breaker that know that L{defer.inlineCallbacks} use
    exceptions in its internal workings.
    """

    def __exit__(self, exc_type, exc_val, tb):
        print "EXIT"
        if exc_type is defer._DefGen_Return:
            print "GOT IT"
            exc_type, exc_val, tb = None, None, None
        return CircuitBreaker.__exit__(self, exc_type, exc_val, tb)


class TwistedCircuitBreakerSet(CircuitBreakerSet):
    """Circuit breaker that supports twisted."""

    def __init__(self, reactor, logger, **kwargs):
        kwargs.update({'factory': TwistedCircuitBreaker})
        CircuitBreakerSet.__init__(self, reactor.seconds, logger,
            **kwargs)

## Instruction:
Remove print statements from TwistedCircuitBreaker
## Code After:

from circuit.breaker import CircuitBreaker, CircuitBreakerSet
try:
    from twisted.internet import defer
except ImportError:
    pass


class TwistedCircuitBreaker(CircuitBreaker):
    """Circuit breaker that know that L{defer.inlineCallbacks} use
    exceptions in its internal workings.
    """

    def __exit__(self, exc_type, exc_val, tb):
        if exc_type is defer._DefGen_Return:
            exc_type, exc_val, tb = None, None, None
        return CircuitBreaker.__exit__(self, exc_type, exc_val, tb)


class TwistedCircuitBreakerSet(CircuitBreakerSet):
    """Circuit breaker that supports twisted."""

    def __init__(self, reactor, logger, **kwargs):
        kwargs.update({'factory': TwistedCircuitBreaker})
        CircuitBreakerSet.__init__(self, reactor.seconds, logger,
            **kwargs)
