Skip to content

Commit

Permalink
graders: raise internal error when using bridged on WSL1
Browse files Browse the repository at this point in the history
Fixes #863.
  • Loading branch information
quantum5 authored and Xyene committed Sep 6, 2021
1 parent 7f9637c commit 7d0135d
Showing 1 changed file with 5 additions and 0 deletions.
5 changes: 5 additions & 0 deletions dmoj/graders/bridged.py
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@
import subprocess

from dmoj.contrib import contrib_modules
from dmoj.cptbox import IS_WSL1
from dmoj.error import InternalError
from dmoj.graders.standard import StandardGrader
from dmoj.judgeenv import env, get_problem_root
Expand All @@ -16,6 +17,10 @@ def __init__(self, judge, problem, language, source):
self.handler_data = self.problem.config.interactive
self.interactor_binary = self._generate_interactor_binary()
self.contrib_type = self.handler_data.get('type', 'default')

if IS_WSL1:
raise InternalError('Using cptbox built on WSL1, bridged interactive grader will not work.')

if self.contrib_type not in contrib_modules:
raise InternalError('%s is not a valid contrib module' % self.contrib_type)

Expand Down

0 comments on commit 7d0135d

Please sign in to comment.