def test_error(self):
    try:
        orig_stdout = sys.stdout
        sys.stdout = io.TextIOWrapper(io.BytesIO(), encoding='ascii')
        compileall.compile_dir(self.directory)
    finally:
        sys.stdout = orig_stdout
def test_error(self):
    try:
        orig_stdout = sys.stdout
        sys.stdout = io.TextIOWrapper(io.BytesIO(), encoding='ascii')
        compileall.compile_dir(self.directory)
    finally:
        sys.stdout = orig_stdout