|
14 | 14 |
|
15 | 15 |
|
16 | 16 | debugger_log = open('/tmp/red.log', 'w')
|
| 17 | + |
17 | 18 | def trace(text):
|
18 | 19 | debugger_log.write(text)
|
19 | 20 | debugger_log.flush()
|
@@ -116,7 +117,7 @@ def hl(src, breakpoint_lines):
|
116 | 117 | text = re.sub(a_ptrn, vt100.bold('\\1'), text)
|
117 | 118 | text = re.sub(b_ptrn, vt100.bold('\\1'), text)
|
118 | 119 |
|
119 |
| - symbol = u'\u2022' if has_breakpoint else ' ' |
| 120 | + symbol = '\u2022' if has_breakpoint else ' ' |
120 | 121 |
|
121 | 122 | # Can't use red twice, the closing color tag will mess the outputs
|
122 | 123 | if not is_current:
|
@@ -170,9 +171,10 @@ def main(args):
|
170 | 171 | return 1
|
171 | 172 |
|
172 | 173 | dbgr = subprocess.Popen(['ocamldebug', '-emacs'] + command_line,
|
| 174 | + encoding='utf-8', |
173 | 175 | stdin=subprocess.PIPE, stdout=subprocess.PIPE, stderr=subprocess.PIPE)
|
174 | 176 |
|
175 |
| - print(debugger_command(dbgr, '')[0].replace('\tOCaml Debugger version ', vt100.red(u'\u2022 RED') + ' OCamlDebug v')) |
| 177 | + print(debugger_command(dbgr, '')[0].replace('\tOCaml Debugger version ', vt100.red('\u2022 RED') + ' OCamlDebug v')) |
176 | 178 | print(vt100.dim('Press ? for help'))
|
177 | 179 | print(debugger_command(dbgr, 'start')[0])
|
178 | 180 |
|
@@ -215,9 +217,9 @@ def prompt(text):
|
215 | 217 | file_name = loc.get('file')
|
216 | 218 | listing = hl(execute('list'), breakpoint_lines_for_file(breakpoints, file_name))
|
217 | 219 | if listing:
|
218 |
| - console.print_text((u'\u2500[ %s ]' % loc.get('file')) + u'\u2500' * 300) |
| 220 | + console.print_text(('\u2500[ %s ]' % loc.get('file')) + '\u2500' * 300) |
219 | 221 | console.print_text(listing)
|
220 |
| - console.print_text(u'\u2500' * 300) |
| 222 | + console.print_text('\u2500' * 300) |
221 | 223 | else:
|
222 | 224 | module = loc.get('module')
|
223 | 225 | if module:
|
|
0 commit comments