summaryrefslogtreecommitdiffstats
path: root/Lib/dos-8x3/py_compi.py
diff options
context:
space:
mode:
authorJeremy Hylton <jeremy@alum.mit.edu>2000-09-26 17:32:27 (GMT)
committerJeremy Hylton <jeremy@alum.mit.edu>2000-09-26 17:32:27 (GMT)
commitd635b1d724e79a1d2dce416b29a95c389fdfab30 (patch)
tree91545a903b9628f4a592b6d911fd9bd23d7510b6 /Lib/dos-8x3/py_compi.py
parent0872e0585196a894c8c2c2dbea1a0fdd68391c90 (diff)
downloadcpython-d635b1d724e79a1d2dce416b29a95c389fdfab30.zip
cpython-d635b1d724e79a1d2dce416b29a95c389fdfab30.tar.gz
cpython-d635b1d724e79a1d2dce416b29a95c389fdfab30.tar.bz2
The Usual
Diffstat (limited to 'Lib/dos-8x3/py_compi.py')
-rwxr-xr-xLib/dos-8x3/py_compi.py5
1 files changed, 5 insertions, 0 deletions
diff --git a/Lib/dos-8x3/py_compi.py b/Lib/dos-8x3/py_compi.py
index c54d61b..b453109 100755
--- a/Lib/dos-8x3/py_compi.py
+++ b/Lib/dos-8x3/py_compi.py
@@ -48,6 +48,11 @@ def compile(file, cfile=None, dfile=None):
except AttributeError:
timestamp = long(os.stat(file)[8])
codestring = f.read()
+ # If parsing from a string, line breaks are \n (see parsetok.c:tok_nextc)
+ # Replace will return original string if pattern is not found, so
+ # we don't need to check whether it is found first.
+ codestring = codestring.replace("\r\n","\n")
+ codestring = codestring.replace("\r","\n")
f.close()
if codestring and codestring[-1] != '\n':
codestring = codestring + '\n'