Commit 9cfe2a77 authored by Denis Bilenko's avatar Denis Bilenko

bench_spawn.py: use __code__ if func_code not available (py3k). Patch by Damien Churchill.

parent c2715d00
......@@ -135,7 +135,10 @@ def bench_all(options):
def all():
result = [x for x in globals() if x.startswith('bench_') and x != 'bench_all']
result.sort(key=lambda x: globals()[x].func_code.co_firstlineno)
try:
result.sort(key=lambda x: globals()[x].func_code.co_firstlineno)
except AttributeError:
result.sort(key=lambda x: globals()[x].__code__.co_firstlineno)
result = [x.replace('bench_', '') for x in result]
return result
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment