def get_capture_stream():
 return getattr(local_context, u'output', None)

def get_capture_stream ( ) : return getattr ( local_context , u'output' , None )
if output is currently being redirected to a stream .