ref: 84838c3a967bbda30f250b4292af3c4c986a60e1
parent: f15b8cf940ae0a55176fa9a7d071a99af0fcb1a9
author: Paul Brossier <piem@piem.org>
date: Tue May 10 19:45:41 EDT 2016
python/demos/demo_reading_speed.py: avoid unused variable, use globals to get function name
--- a/python/demos/demo_reading_speed.py
+++ b/python/demos/demo_reading_speed.py
@@ -109,7 +109,7 @@
def test_speed(function, filename):
times = []
- for i in range(10):
+ for _ in range(10):
start = time.time()
try:
total_frames, samplerate = function(filename)
@@ -134,4 +134,6 @@
filename = sys.argv[1]
for f in test_functions:
- test_speed(eval(f), filename)
+ # get actual function from globals
+ test_function = globals()[f]
+ test_speed(test_function, filename)