def no_tracing(func):
 if (not hasattr(sys, 'gettrace')):
  return func
 else:
  def wrapper(*args, **kwargs):
   original_trace = sys.gettrace()
   try:
    sys.settrace(None)
    return func(*args, **kwargs)
   finally:
    sys.settrace(original_trace)
  wrapper.__name__ = func.__name__
  return wrapper

def no_tracing ( func ) : if ( not hasattr ( sys , 'gettrace' ) ) : return func else : def wrapper ( * args , ** kwargs ) : original_trace = sys . gettrace ( ) try : sys . settrace ( None ) return func ( * args , ** kwargs ) finally : sys . settrace ( original_trace ) wrapper . __name__ = func . __name__ return wrapper
decorator to temporarily turn off tracing for the duration of a test .