Is there a simple way to use a 'with' statement to redirect stdout in a
block?