Skip to content

Commit f9ce31c

Browse files
committed
[interactive] #102 Move not-None assertions closer to usage
Because when running `bt test` for an interactive problem, and `validator_error` and `team_error` are `False`, the `.stderr` properties actually do not exist, and that's fine.
1 parent 0feed3b commit f9ce31c

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

bin/interactive.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -263,8 +263,6 @@ def get_validator_command():
263263
)
264264
submission_pid = submission.pid
265265

266-
assert validator.stderr and submission.stderr
267-
268266
stop_kill_handler = threading.Event()
269267
submission_time: Optional[float] = None
270268

@@ -387,9 +385,11 @@ def kill_handler_function():
387385

388386
val_err = None
389387
if validator_error is False:
388+
assert validator.stderr
390389
val_err = _feedback(run, validator.stderr.read())
391390
team_err = None
392391
if team_error is False:
392+
assert submission.stderr
393393
team_err = submission.stderr.read().decode('utf-8', 'replace')
394394

395395
if verdict == Verdict.TIME_LIMIT_EXCEEDED:

0 commit comments

Comments
 (0)