bpo-43651: Fix test_compileall with PEP 597 (GH-25128)

This commit is contained in:
Inada Naoki 2021-04-02 09:01:57 +09:00 committed by GitHub
parent c0ec4486dc
commit 80017752ba
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
3 changed files with 9 additions and 9 deletions

View file

@ -419,7 +419,7 @@ def _close_stdin():
try:
fd = os.open(os.devnull, os.O_RDONLY)
try:
sys.stdin = open(fd, closefd=False)
sys.stdin = open(fd, encoding="utf-8", closefd=False)
except:
os.close(fd)
raise