Skip to content

Commit 0954547

Browse files
committed
Turn exception into assertion
It should be the latter since we are the ones calling into this routine. Signed-off-by: Rodrigo Tobar <[email protected]>
1 parent ec5c536 commit 0954547

File tree

1 file changed

+1
-2
lines changed

1 file changed

+1
-2
lines changed

benchmark.py renamed to ijson/benchmark.py

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -139,8 +139,7 @@ def stats(values):
139139
return min(values), total / float(len(values)), median(values), max(values)
140140

141141
def run_benchmarks(args, benchmark_func=None, fname=None):
142-
if bool(benchmark_func) == bool(fname):
143-
raise ValueError("Either benchmark_func or fname must be given")
142+
assert bool(benchmark_func) != bool(fname)
144143
if benchmark_func:
145144
bname = benchmark_func.__name__
146145
with progress_message('Generating data for benchmark %s...' % (bname,)):

0 commit comments

Comments
 (0)