Skip to content

Commit

Permalink
Add try/catch to stop failures
Browse files Browse the repository at this point in the history
  • Loading branch information
carlini committed Mar 19, 2024
1 parent 06a4030 commit 5b7c71d
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 5 deletions.
8 changes: 6 additions & 2 deletions docker_controller.py
Original file line number Diff line number Diff line change
Expand Up @@ -165,9 +165,13 @@ def remove_ansi(text):

def __call__(self, cmd):
# Send the command through the PTY
self.process.stdin.write((cmd + "\n"))
print("GO", self.process.stdin)
self.process.stdin.flush()
try:
self.process.stdin.write((cmd + "\n"))
self.process.stdin.flush()
except:
print("Process was terminated")
return "Process was terminated"

# Read the output until the EOS string is encountered
output = []
Expand Down
6 changes: 3 additions & 3 deletions evaluator.py
Original file line number Diff line number Diff line change
Expand Up @@ -641,8 +641,8 @@ def __init__(self):
pass

def __call__(self, code):
#try:
if 1:
try:
#if 1:
from selenium import webdriver
from selenium.webdriver.chrome.options import Options

Expand Down Expand Up @@ -680,7 +680,7 @@ def __call__(self, code):

yield img_data, Reason(type(self), img_data)

try:
#try:
pass

except:
Expand Down

0 comments on commit 5b7c71d

Please sign in to comment.