fix timeout
This commit is contained in:
parent
1bdc4ec719
commit
589fbebf3e
|
@ -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():
|
||||
|
|
Loading…
Reference in New Issue