From ea6692a83e7132aa18a8032ae3c76fa91d9d50f2 Mon Sep 17 00:00:00 2001
From: Paul Sokolovsky <pfalcon@users.sourceforge.net>
Date: Thu, 5 Oct 2017 23:40:19 +0300
Subject: [PATCH] tools/pyboard: Use repr() when quoting data in error
 messages.

As it may contain newlines, etc.
---
 tools/pyboard.py | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/tools/pyboard.py b/tools/pyboard.py
index d15f520ac..887473071 100755
--- a/tools/pyboard.py
+++ b/tools/pyboard.py
@@ -343,7 +343,7 @@ class Pyboard:
         # check if we could exec command
         data = self.serial.read(2)
         if data != b'OK':
-            raise PyboardError('could not exec command (response: %s)' % data)
+            raise PyboardError('could not exec command (response: %r)' % data)
 
     def exec_raw(self, command, timeout=10, data_consumer=None):
         self.exec_raw_no_follow(command);
-- 
GitLab