Open file in universal newline mode when passing to compile(). Solution

from Felix Wiemann.  Closes patch #934971.
This commit is contained in:
Skip Montanaro 2004-04-16 03:28:19 +00:00
parent 10659f2540
commit c00fc8452e

View file

@ -418,7 +418,7 @@ def find_executable_linenos(filename):
"""Return dict where keys are line numbers in the line number table."""
assert filename.endswith('.py')
try:
prog = open(filename).read()
prog = open(filename, "rU").read()
except IOError, err:
print >> sys.stderr, ("Not printing coverage data for %r: %s"
% (filename, err))