Skip to content

Commit 4eccd3e

Browse files
committed
Use open from io only for source loading
Merely replacing all the open() invocations caused issues with Python 2. Fixes #241
1 parent 9f101cd commit 4eccd3e

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

.gdbinit

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -29,13 +29,13 @@ python
2929
# Imports ----------------------------------------------------------------------
3030

3131
import ast
32+
import io
3233
import itertools
3334
import math
3435
import os
3536
import re
3637
import struct
3738
import traceback
38-
from io import open
3939

4040
# Common attributes ------------------------------------------------------------
4141

@@ -1185,7 +1185,7 @@ class Source(Dashboard.Module):
11851185
if style_changed or file_name != self.file_name or ts and ts > self.ts:
11861186
try:
11871187
# reload the source file if changed
1188-
with open(file_name, errors='ignore') as source_file:
1188+
with io.open(file_name, errors='ignore') as source_file:
11891189
highlighter = Beautifier(file_name, self.tab_size)
11901190
self.highlighted = highlighter.active
11911191
source = highlighter.process(source_file.read())

0 commit comments

Comments
 (0)