test_klippy: Convert to Python3 string encoding
Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
This commit is contained in:
parent
2978771ce5
commit
9ce07921c4
|
@ -37,7 +37,7 @@ class TestCase:
|
||||||
config_fname = gcode_fname = dict_fnames = None
|
config_fname = gcode_fname = dict_fnames = None
|
||||||
should_fail = multi_tests = False
|
should_fail = multi_tests = False
|
||||||
gcode = []
|
gcode = []
|
||||||
f = open(self.fname, 'rb')
|
f = open(self.fname, 'r')
|
||||||
for line in f:
|
for line in f:
|
||||||
cpos = line.find('#')
|
cpos = line.find('#')
|
||||||
if cpos >= 0:
|
if cpos >= 0:
|
||||||
|
@ -78,7 +78,7 @@ class TestCase:
|
||||||
if gcode_fname is None:
|
if gcode_fname is None:
|
||||||
gcode_fname = self.relpath(TEMP_GCODE_FILE, 'temp')
|
gcode_fname = self.relpath(TEMP_GCODE_FILE, 'temp')
|
||||||
gcode_is_temp = True
|
gcode_is_temp = True
|
||||||
f = open(gcode_fname, 'wb')
|
f = open(gcode_fname, 'w')
|
||||||
f.write('\n'.join(gcode + ['']))
|
f.write('\n'.join(gcode + ['']))
|
||||||
f.close()
|
f.close()
|
||||||
elif gcode:
|
elif gcode:
|
||||||
|
@ -126,7 +126,7 @@ class TestCase:
|
||||||
return "internal error"
|
return "internal error"
|
||||||
return "success"
|
return "success"
|
||||||
def show_log(self):
|
def show_log(self):
|
||||||
f = open(TEMP_LOG_FILE, 'rb')
|
f = open(TEMP_LOG_FILE, 'r')
|
||||||
data = f.read()
|
data = f.read()
|
||||||
f.close()
|
f.close()
|
||||||
sys.stdout.write(data)
|
sys.stdout.write(data)
|
||||||
|
|
Loading…
Reference in New Issue