diff --git a/tests/test-hgweb-no-path-info.t b/tests/test-hgweb-no-path-info.t --- a/tests/test-hgweb-no-path-info.t +++ b/tests/test-hgweb-no-path-info.t @@ -36,6 +36,7 @@ > print('---- HEADERS') > print([i for i in headers if i[0] != 'ETag']) > print('---- DATA') + > sys.stdout.flush() > return output.write > > env = { @@ -55,12 +56,19 @@ > } > > def process(app): + > try: + > stdout = sys.stdout.buffer + > except AttributeError: + > stdout = sys.stdout > content = app(env, startrsp) - > sys.stdout.write(output.getvalue()) - > sys.stdout.write(''.join(content)) + > stdout.write(output.getvalue()) + > stdout.write(b''.join(content)) + > stdout.flush() > getattr(content, 'close', lambda : None)() - > print('---- ERRORS') - > print(errors.getvalue()) + > if errors.getvalue(): + > print('---- ERRORS') + > print(errors.getvalue()) + > sys.stdout.flush() > > output = stringio() > env['QUERY_STRING'] = 'style=atom' @@ -130,8 +138,6 @@ - ---- ERRORS - ---- STATUS 200 Script output follows ---- HEADERS @@ -140,7 +146,5 @@ /repo/ - ---- ERRORS - $ cd ..