Skip to content

Commit

Permalink
Fix Compare stop_on_incorrect back-breaking change
Browse files Browse the repository at this point in the history
  • Loading branch information
lin-toto committed Dec 13, 2017
1 parent fe9ce92 commit 8b8d67c
Showing 1 changed file with 11 additions and 2 deletions.
13 changes: 11 additions & 2 deletions cyaron/compare.py
Original file line number Diff line number Diff line change
Expand Up @@ -47,11 +47,15 @@ def __normal_max_workers(workers):

@classmethod
def output(cls, *files, **kwargs):
kwargs = unpack_kwargs('output', kwargs, ('std', ('grader', DEFAULT_GRADER), ('max_workers', -1), ('job_pool', None)))
kwargs = unpack_kwargs('output', kwargs, ('std', ('grader', DEFAULT_GRADER), ('max_workers', -1),
('job_pool', None), ('stop_on_incorrect', None)))
std = kwargs['std']
grader = kwargs['grader']
max_workers = kwargs['max_workers']
job_pool = kwargs['job_pool']
if kwargs['stop_on_incorrect'] is not None:
log.warn("parameter stop_on_incorrect is deprecated and has no effect.")

if (max_workers is None or max_workers >= 0) and job_pool is None:
max_workers = cls.__normal_max_workers(max_workers)
try:
Expand Down Expand Up @@ -79,13 +83,18 @@ def do(file):

@classmethod
def program(cls, *programs, **kwargs):
kwargs = unpack_kwargs('program', kwargs, ('input', ('std', None), ('std_program', None), ('grader', DEFAULT_GRADER), ('max_workers', -1), ('job_pool', None)))
kwargs = unpack_kwargs('program', kwargs, ('input', ('std', None), ('std_program', None),
('grader', DEFAULT_GRADER), ('max_workers', -1),
('job_pool', None), ('stop_on_incorrect', None)))
input = kwargs['input']
std = kwargs['std']
std_program = kwargs['std_program']
grader = kwargs['grader']
max_workers = kwargs['max_workers']
job_pool = kwargs['job_pool']
if kwargs['stop_on_incorrect'] is not None:
log.warn("parameter stop_on_incorrect is deprecated and has no effect.")

if (max_workers is None or max_workers >= 0) and job_pool is None:
max_workers = cls.__normal_max_workers(max_workers)
try:
Expand Down

0 comments on commit 8b8d67c

Please sign in to comment.