bpo-40260: Remove unnecessary newline in compile() call (GH-19641)

Because some people subclass this class and call undocumented methods, and we don't want to break them.
(cherry picked from commit 39652cd8bd)

Co-authored-by: Anthony Sottile <asottile@umich.edu>
This commit is contained in:
Miss Islington (bot) 2020-04-22 12:05:10 -07:00 committed by GitHub
parent 4a6da0b63b
commit fc45cb4400
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

View file

@ -339,7 +339,7 @@ class ModuleFinder:
self.msgout(2, "load_module ->", m)
return m
if type == _PY_SOURCE:
co = compile(fp.read()+b'\n', pathname, 'exec')
co = compile(fp.read(), pathname, 'exec')
elif type == _PY_COMPILED:
try:
data = fp.read()