ensure stdout is flushed immediately during pretty_print

pretty straightforward.

If it's not too much trouble, could the next version be released this week?
please let me know how I can help!