]> granicus.if.org Git - python/commitdiff
no need to translate newlines in python code anymore
authorBenjamin Peterson <benjamin@python.org>
Fri, 13 Nov 2009 00:45:32 +0000 (00:45 +0000)
committerBenjamin Peterson <benjamin@python.org>
Fri, 13 Nov 2009 00:45:32 +0000 (00:45 +0000)
Lib/importlib/_bootstrap.py

index 02f5c492c5f08779f73ac13de727b8d20ae07cf1..ed1598bc9e149a4157c6ec4e6436b886f0011f8a 100644 (file)
@@ -344,21 +344,6 @@ class PyLoader:
             message = "a source path must exist to load {0}".format(fullname)
             raise ImportError(message)
         source = self.get_data(source_path)
-        # Convert to universal newlines.
-        line_endings = b'\n'
-        for index, c in enumerate(source):
-            if c == ord(b'\n'):
-                break
-            elif c == ord(b'\r'):
-                line_endings = b'\r'
-                try:
-                    if source[index+1] == ord(b'\n'):
-                        line_endings += b'\n'
-                except IndexError:
-                    pass
-                break
-        if line_endings != b'\n':
-            source = source.replace(line_endings, b'\n')
         return compile(source, source_path, 'exec', dont_inherit=True)
 
     # Never use in implementing import! Imports code within the method.