Skip to content

Commit 2ea242f

Browse files
committed
bm_pickle: Rename is_module_accelerated to is_accelerated_module
1 parent 8a2d7b5 commit 2ea242f

File tree

1 file changed

+4
-4
lines changed

1 file changed

+4
-4
lines changed

pyperformance/benchmarks/bm_pickle.py

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -236,8 +236,8 @@ def bench_pickle_dict(loops, pickle, options):
236236
}
237237

238238

239-
def is_module_accelerated(module):
240-
return getattr(pickle.Pickler, '__module__', '<jython>') == 'pickle'
239+
def is_accelerated_module(module):
240+
return getattr(pickle.Pickler, '__module__', '<jython>') != 'pickle'
241241

242242

243243
def add_cmdline_args(cmd, args):
@@ -269,12 +269,12 @@ def add_cmdline_args(cmd, args):
269269
if not (options.pure_python or IS_PYPY):
270270
# C accelerators are enabled by default on 3.x
271271
import pickle
272-
if is_module_accelerated(pickle):
272+
if not is_accelerated_module(pickle):
273273
raise RuntimeError("Missing C accelerators for pickle")
274274
else:
275275
sys.modules['_pickle'] = None
276276
import pickle
277-
if not is_module_accelerated(pickle):
277+
if is_accelerated_module(pickle):
278278
raise RuntimeError("Unexpected C accelerators for pickle")
279279

280280
if options.protocol is None:

0 commit comments

Comments
 (0)