diff --git a/Lib/py_compile.py b/Lib/py_compile.py index 859136550d3..9f34a0b38ed 100644 --- a/Lib/py_compile.py +++ b/Lib/py_compile.py @@ -112,8 +112,6 @@ def compile(file, cfile=None, dfile=None, doraise=False): except AttributeError: timestamp = int(os.stat(file).st_mtime) codestring = f.read() - if codestring and codestring[-1] != '\n': - codestring = codestring + '\n' try: codeobject = builtins.compile(codestring, dfile or file,'exec') except Exception as err: