From 589fbebf3efeb6d9f4f04df02586cc1183c4b63a Mon Sep 17 00:00:00 2001 From: d_m Date: Tue, 23 Jan 2024 11:07:09 -0500 Subject: [PATCH] fix timeout --- uxnrepl.py | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/uxnrepl.py b/uxnrepl.py index 019c574..759e80d 100644 --- a/uxnrepl.py +++ b/uxnrepl.py @@ -1,7 +1,7 @@ #!/usr/bin/python from os import system -from subprocess import run +from subprocess import run, TimeoutExpired from sys import stdin, stdout from tempfile import mkstemp @@ -55,13 +55,13 @@ def execute(s, sandbox=None, timeout=2.0): try: res = run(['uxnasm', tmp_tal, tmp_rom], cwd=sandbox, capture_output=True, timeout=timeout) except TimeoutExpired: - return 'uxnasm: timed out' + return b'uxnasm: timed out' if res.returncode != 0: return res.stderr try: res = run(['uxncli', tmp_rom], cwd=sandbox, capture_output=True, timeout=timeout) except TimeoutExpired: - return 'uxncli: timed out' + return b'uxncli: timed out' return res.stdout def main():