diff options
author | Miss Islington (bot) <31488909+miss-islington@users.noreply.github.com> | 2020-04-22 19:05:10 (GMT) |
---|---|---|
committer | GitHub <noreply@github.com> | 2020-04-22 19:05:10 (GMT) |
commit | fc45cb4400409572f05c8b54f2c6f06cbefb1b4e (patch) | |
tree | 7459197510a5cc3db383437d16018f83eeaa5295 | |
parent | 4a6da0b63ba0fb811bfa3cacd69d22a9c0b24a4d (diff) | |
download | cpython-fc45cb4400409572f05c8b54f2c6f06cbefb1b4e.zip cpython-fc45cb4400409572f05c8b54f2c6f06cbefb1b4e.tar.gz cpython-fc45cb4400409572f05c8b54f2c6f06cbefb1b4e.tar.bz2 |
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 39652cd8bdf7c82b7c6055089a4ed90ee546a448)
Co-authored-by: Anthony Sottile <asottile@umich.edu>
-rw-r--r-- | Lib/modulefinder.py | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/Lib/modulefinder.py b/Lib/modulefinder.py index 361a673..aadcd23 100644 --- a/Lib/modulefinder.py +++ b/Lib/modulefinder.py @@ -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() |