Beispiel #1
0
    setattr(module, 'BufferedRandom', _pyio.BufferedRandom)
    setattr(module, 'BufferedRWPair', _pyio.BufferedRWPair)
    setattr(module, 'BufferedWriter', _pyio.BufferedWriter)
    setattr(module, 'BufferedReader', _pyio.BufferedReader)
    setattr(module, 'StringIO', _pyio.StringIO)
    setattr(module, '_IOBase', _pyio.IOBase)
    setattr(module, 'BufferedIOBase', _pyio.BufferedIOBase)
    setattr(module, 'RawIOBase', _pyio.RawIOBase)
    setattr(module, 'FileIO', _pyio.FileIO)
    setattr(module, 'BytesIO', _pyio.BytesIO)
    setattr(module, '_TextIOBase', _pyio.TextIOBase)

setattr(builtins, 'open', open)

sys.stdin = _pyio.TextIOWrapper(_pyio.BufferedReader(sys.stdin),
                                encoding="utf-8",
                                line_buffering=True)
sys.stdin.mode = "r"
sys.__stdin__ = sys.stdin
sys.stdout = _pyio.TextIOWrapper(_pyio.BufferedWriter(sys.stdout),
                                 encoding="utf-8",
                                 line_buffering=True)
sys.stdout.mode = "w"
sys.__stdout__ = sys.stdout
sys.stderr = _pyio.TextIOWrapper(_pyio.BufferedWriter(sys.stderr),
                                 encoding="utf-8",
                                 errors="backslashreplace",
                                 line_buffering=True)
sys.stderr.mode = "w"
sys.__stderr__ = sys.stderr
Beispiel #2
0
    setattr(module, 'BufferedRandom', _pyio.BufferedRandom)
    setattr(module, 'BufferedRWPair', _pyio.BufferedRWPair)
    setattr(module, 'BufferedWriter', _pyio.BufferedWriter)
    setattr(module, 'BufferedReader', _pyio.BufferedReader)
    setattr(module, 'StringIO', _pyio.StringIO)
    setattr(module, '_IOBase', _pyio.IOBase)
    setattr(module, 'BufferedIOBase', _pyio.BufferedIOBase)
    setattr(module, 'RawIOBase', _pyio.RawIOBase)
    setattr(module, 'FileIO', _pyio.FileIO)
    setattr(module, 'BytesIO', _pyio.BytesIO)
    setattr(module, '_TextIOBase', _pyio.TextIOBase)

setattr(builtins, 'open', open)

sys.stdin = _pyio.TextIOWrapper(_pyio.BufferedReader(sys.stdin),
                                encoding=__graalpython__.stdio_encoding,
                                errors=__graalpython__.stdio_error,
                                line_buffering=True)
sys.stdin.mode = "r"
sys.__stdin__ = sys.stdin
sys.stdout = _pyio.TextIOWrapper(_pyio.BufferedWriter(sys.stdout),
                                 encoding=__graalpython__.stdio_encoding,
                                 errors=__graalpython__.stdio_error,
                                 line_buffering=True)
sys.stdout.mode = "w"
sys.__stdout__ = sys.stdout
sys.stderr = _pyio.TextIOWrapper(_pyio.BufferedWriter(sys.stderr.file_io),
                                 encoding=__graalpython__.stdio_encoding,
                                 errors="backslashreplace",
                                 line_buffering=True)
sys.stderr.mode = "w"
sys.__stderr__ = sys.stderr