Fix the error handling around YUKICODER_TOKEN
@@ -63,10 +63,14 @@ def verify_file(path: pathlib.Path, *, compilers: List[str], jobs: int) -> bool:
exec_command(['sleep', '2'])
command = ['oj', 'download', '--system', '-d', shlex.quote(str(directory / 'test')), url]
- if isinstance(problem, onlinejudge.service.yukicoder.YukicoderProblem):
- assert 'YUKICODER_TOKEN' in os.environ
+ if os.environ.get('YUKICODER_TOKEN'):
command += ['--yukicoder-token', os.environ['YUKICODER_TOKEN']]
+ try:
exec_command(command)
+ except:
+ if isinstance(problem, onlinejudge.service.yukicoder.YukicoderProblem) and not os.environ.get('YUKICODER_TOKEN'):
+ logger.warning('the $YUKICODER_TOKEN environment variable is not set')
+ raise
# compile the ./a.out
language.compile(path, basedir=pathlib.Path.cwd(), tempdir=directory)
