]> git.ipfire.org Git - thirdparty/Python/cpython.git/commitdiff
bpo-40260: Remove unnecessary newline in compile() call (GH-19641)
authorMiss Islington (bot) <31488909+miss-islington@users.noreply.github.com>
Wed, 22 Apr 2020 19:05:10 +0000 (12:05 -0700)
committerGitHub <noreply@github.com>
Wed, 22 Apr 2020 19:05:10 +0000 (12:05 -0700)
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>
Lib/modulefinder.py

index 361a6730c06746c77f77cbf2774684d268001b0c..aadcd23edbaaa7c91eb28ffe56b4cd75ab4d418f 100644 (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()