bpo-45428: Fix reading filenames from stdin in py_compile (GH-28848)

Strip trailing '\n'.
This commit is contained in:
Graham Inggs 2021-10-15 11:38:55 +02:00 committed by GitHub
parent 8e5de40f90
commit 59a633d3e2
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 2 additions and 1 deletions

View File

@ -190,7 +190,7 @@ def main():
)
args = parser.parse_args()
if args.filenames == ['-']:
filenames = sys.stdin.readlines()
filenames = [filename.rstrip('\n') for filename in sys.stdin.readlines()]
else:
filenames = args.filenames
for filename in filenames:

View File

@ -0,0 +1 @@
Fix a regression in py_compile when reading filenames from standard input.