From 1307f9801bd0d6920a6569ad9064da2915ff6a0b Mon Sep 17 00:00:00 2001 From: Kliment Date: Mon, 22 Aug 2011 12:09:39 +0200 Subject: [PATCH] Fix crash caused by serial error with fiveD firmware on resend request. --- printcore.py | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/printcore.py b/printcore.py index b265d61..7114230 100755 --- a/printcore.py +++ b/printcore.py @@ -115,7 +115,11 @@ class printcore(): #callback for errors pass if "resend" in line.lower() or "rs" in line: - toresend=int(line.replace("N:"," ").replace("N"," ").replace(":"," ").split()[-1]) + try: + toresend=int(line.replace("N:"," ").replace("N"," ").replace(":"," ").split()[-1]) + except: + if "rs" in line: + toresend=int(line.split()[1]) self.resendfrom=toresend self.clear=True self.clear=True