This is an automated email from the ASF dual-hosted git repository.

areusch pushed a commit to branch main
in repository https://gitbox.apache.org/repos/asf/tvm.git


The following commit(s) were added to refs/heads/main by this push:
     new cddb0f6  Update QemuTransport#write() to match new write API contract. 
(#8761)
cddb0f6 is described below

commit cddb0f6d566e738a6b45be662a498fd8ac69dab7
Author: Andrew Reusch <[email protected]>
AuthorDate: Tue Aug 17 13:36:58 2021 -0700

    Update QemuTransport#write() to match new write API contract. (#8761)
    
    * suspect this should fix #8278
---
 apps/microtvm/zephyr/template_project/microtvm_api_server.py | 6 +++---
 1 file changed, 3 insertions(+), 3 deletions(-)

diff --git a/apps/microtvm/zephyr/template_project/microtvm_api_server.py 
b/apps/microtvm/zephyr/template_project/microtvm_api_server.py
index 30a61bb..d937728 100644
--- a/apps/microtvm/zephyr/template_project/microtvm_api_server.py
+++ b/apps/microtvm/zephyr/template_project/microtvm_api_server.py
@@ -678,9 +678,9 @@ class ZephyrQemuTransport:
                 escape_pos.append(i)
             to_write.append(b)
 
-        num_written = server.write_with_timeout(self.write_fd, to_write, 
timeout_sec)
-        num_written -= sum(1 if x < num_written else 0 for x in escape_pos)
-        return num_written
+        while to_write:
+            num_written = server.write_with_timeout(self.write_fd, to_write, 
timeout_sec)
+            to_write = to_write[num_written:]
 
     def _qemu_check_stdout(self):
         for line in self.proc.stdout:

Reply via email to