Skip to contentSkip to conversation

patman: Avoid circular dependency between command and tools

PATCH New Simon Glass 1 participant 2 messages May 16, 2020 – May 17, 2020

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 patman: Avoid circular dependency between command and tools

This seems to cause problems in some cases. Split the dependency by copying the code to command.

---

 tools/patman/command.py | 7 +++----
 1 file changed, 3 insertions(+), 4 deletions(-)
tools/patman/command.py +3 -4
index e67ac159e5..bf8ea6c8c3 100644
@@ -5,7 +5,6 @@
 import os
 
 from patman import cros_subprocess
-from patman import tools
 
 """Shell command ease-ups for Python."""
 
@@ -35,9 +34,9 @@ class CommandResult:
 
     def ToOutput(self, binary):
         if not binary:
-            self.stdout = tools.ToString(self.stdout)
-            self.stderr = tools.ToString(self.stderr)
-            self.combined = tools.ToString(self.combined)
+            self.stdout = self.stdout.decode('utf-8')
+            self.stderr = self.stderr.decode('utf-8')
+            self.combined = self.combined.decode('utf-8')
         return self
 
 
Signature · 1 line
2.26.2.761.g0e0b3e54be-goog
#1 lore raw

PATCH 1/1 patman: Avoid circular dependency between command and tools

Quoted 38 lines · Simon Glass

This seems to cause problems in some cases. Split the dependency by copying the code to command.

---

 tools/patman/command.py | 7 +++----
 1 file changed, 3 insertions(+), 4 deletions(-)
tools/patman/command.py +3 -5
index e67ac159e5..bf8ea6c8c3 100644
@@ -5,7 +5,6 @@
 import os
 
 from patman import cros_subprocess
-from patman import tools
 
 """Shell command ease-ups for Python."""
 
@@ -35,9 +34,9 @@ class CommandResult:
 
     def ToOutput(self, binary):
         if not binary:
-            self.stdout = tools.ToString(self.stdout)
-            self.stderr = tools.ToString(self.stderr)
-            self.combined = tools.ToString(self.combined)
+            self.stdout = self.stdout.decode('utf-8')
+            self.stderr = self.stderr.decode('utf-8')
+            self.combined = self.combined.decode('utf-8')
         return self
 
 
--

2.26.2.761.g0e0b3e54be-goog