freemyipod r959 - Code Review

Jump to: navigation, search
Repository:freemyipod
Revision:r958‎ | r959 | r960 >
Date:00:57, 19 June 2014
Author:theseven
Status:new
Tags:
Comment:
emcore.py: Fix device console commands on python 3
Modified paths:
  • /emcore/trunk/tools/emcore.py (modified) (history)

Diff [purge]

Index: emcore/trunk/tools/emcore.py
@@ -436,7 +436,7 @@
437437 bitmask = to_int(bitmask)
438438 while True:
439439 resp = self.emcore.cread()
440 - self.logger.write(resp.data)
 440+ self.logger.write(resp.data.decode("ascii"))
441441 time.sleep(0.1 / resp.maxsize * (resp.maxsize - len(resp.data)))
442442
443443 @command
@@ -451,7 +451,7 @@
452452 text += word + " "
453453 text = text[:-1]
454454 self.logger.info("Writing '%s' to the device consoles identified with 0x%X\n" % (text, bitmask))
455 - self.emcore.cwrite(text, bitmask)
 455+ self.emcore.cwrite(text.encode("ascii"), bitmask)
456456
457457 @command
458458 def flushconsolebuffers(self, bitmask):