Skip to content

Commit 611896e

Browse files
authored
Rollup merge of #116133 - pouriya:refactor-bootstrap.py, r=albertlarsan68
ref(bootstrap.py): add `eprint` function Implemented a 3-line function called `eprint` which is just like `print` but for `stderr`. So each `print(..., file=sys.stderr)` becomes `eprint(...)`. <br/> Testing `eprint` function: ```sh $ cat eprint.py ``` ```python import sys def eprint(*args, **kwargs): kwargs['file'] = sys.stderr print(*args, **kwargs) eval('eprint({})'.format(sys.argv[1])) ``` ```sh $ python3 eprint.py '"hello"' hello $ ``` ```sh $ python3 eprint.py '"hello"' 2>/dev/null $ ``` ```sh $ python3 eprint.py '"hello", "world", flush=True, file=sys.stdout' hello world $ ``` ```sh $ python3 eprint.py '"hello", "world", flush=True, file=sys.stdout' 2>/dev/null $ ```
2 parents eea20cc + c520e15 commit 611896e

File tree

0 file changed

+0
-0
lines changed

    0 file changed

    +0
    -0
    lines changed

    0 commit comments

    Comments
     (0)