Skip to content

Commit

Permalink
Merge pull request #6 from afeena/fix-return-value
Browse files Browse the repository at this point in the history
Define stdout_value at the beginning of the function
  • Loading branch information
glaslos authored Dec 26, 2018
2 parents 70da411 + 95748f9 commit 001437b
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion sandbox.py
Original file line number Diff line number Diff line change
Expand Up @@ -53,13 +53,13 @@ def read_process(self):

@asyncio.coroutine
def sandbox(self, script, phpbin="php7.0"):
self.stdout_value = b''
if not os.path.isfile(script):
raise Exception("Sample not found: {0}".format(script))

try:
cmd = [phpbin, "sandbox.php", script]
self.proc = yield from asyncio.create_subprocess_exec(*cmd, stdout=PIPE)
self.stdout_value = b''
yield from asyncio.wait_for(self.read_process(), timeout=3)
except Exception as e:
try:
Expand Down

0 comments on commit 001437b

Please sign in to comment.