Skip to content

Commit

Permalink
Turn exception into assertion
Browse files Browse the repository at this point in the history
It should be the latter since we are the ones calling into this routine.

Signed-off-by: Rodrigo Tobar <[email protected]>
  • Loading branch information
rtobar committed Nov 30, 2023
1 parent ec5c536 commit 0954547
Showing 1 changed file with 1 addition and 2 deletions.
3 changes: 1 addition & 2 deletions benchmark.py → ijson/benchmark.py
Original file line number Diff line number Diff line change
Expand Up @@ -139,8 +139,7 @@ def stats(values):
return min(values), total / float(len(values)), median(values), max(values)

def run_benchmarks(args, benchmark_func=None, fname=None):
if bool(benchmark_func) == bool(fname):
raise ValueError("Either benchmark_func or fname must be given")
assert bool(benchmark_func) != bool(fname)
if benchmark_func:
bname = benchmark_func.__name__
with progress_message('Generating data for benchmark %s...' % (bname,)):
Expand Down

0 comments on commit 0954547

Please sign in to comment.