diff options
author | Jack Jansen <jack.jansen@cwi.nl> | 2002-09-11 22:05:02 (GMT) |
---|---|---|
committer | Jack Jansen <jack.jansen@cwi.nl> | 2002-09-11 22:05:02 (GMT) |
commit | f6b3fddfc332382935bdd94671c008fe66d306bb (patch) | |
tree | 54a4856e60e276d1e6734e7007ddb41276683547 /Mac | |
parent | 73e8ebfc5ae96d997240dd4111e1fe5a3992a2b4 (diff) | |
download | cpython-f6b3fddfc332382935bdd94671c008fe66d306bb.zip cpython-f6b3fddfc332382935bdd94671c008fe66d306bb.tar.gz cpython-f6b3fddfc332382935bdd94671c008fe66d306bb.tar.bz2 |
The debugger source view only understood mac-style linefeeds. Fixed.
Diffstat (limited to 'Mac')
-rw-r--r-- | Mac/Tools/IDE/PyDebugger.py | 5 |
1 files changed, 3 insertions, 2 deletions
diff --git a/Mac/Tools/IDE/PyDebugger.py b/Mac/Tools/IDE/PyDebugger.py index 74bfc74..250d5d3 100644 --- a/Mac/Tools/IDE/PyDebugger.py +++ b/Mac/Tools/IDE/PyDebugger.py @@ -345,7 +345,7 @@ class Debugger(bdb.Bdb): self.w.panes.bottom.src.source.set(editor.get(), filename) else: try: - f = open(filename, 'rb') + f = open(filename, 'rT') data = f.read() f.close() except IOError: @@ -360,7 +360,7 @@ class Debugger(bdb.Bdb): if f: f.close() if f and suff == '.py': - f = open(filename, 'rb') + f = open(filename, 'rT') data = f.read() f.close() self.w.panes.bottom.src.source.set(data, filename) @@ -369,6 +369,7 @@ class Debugger(bdb.Bdb): else: self.w.panes.bottom.src.source.set("can't find file") else: + data = data.replace('\n', '\r') self.w.panes.bottom.src.source.set(data, filename) self.file = filename self.w.panes.bottom.srctitle.set('Source: ' + filename + ((lineno > 0) and (' (line %d)' % lineno) or ' ')) |