From a4aa6c469143c4aff0af1906d02f0cdb55281d25 Mon Sep 17 00:00:00 2001 From: Idan Pazi Date: Sun, 25 Feb 2024 20:05:53 +0200 Subject: [PATCH] previewer - flush before run --- previewer/__init__.py | 2 ++ 1 file changed, 2 insertions(+) diff --git a/previewer/__init__.py b/previewer/__init__.py index e7d0fc8..670ef5d 100644 --- a/previewer/__init__.py +++ b/previewer/__init__.py @@ -169,6 +169,8 @@ def run(self): while True: try: code, assign, do_preview = self.exec_conn.recv() + while self.exec_conn.poll(): # take only latest + code, assign, do_preview = self.exec_conn.recv() # unmask ctrl+c signal.signal(signal.SIGINT, signal.default_int_handler) ctrl_c_timer = threading.Timer(CTRL_C_TIMEOUT, self.ctrl_c)