revert (mis)use of sys.stdout.