TypeError fix for unexpected NoneType in list

FIX: TypeError: unsupported operand type(s) for +: 'int' and 'NoneType'

Caused when the "finished" list is summed with the function "sum".
This commit is contained in:
E. Almqvist 2021-11-30 09:43:18 +01:00
parent 22210ca352
commit 10a4ccba0a
1 changed files with 2 additions and 1 deletions

View File

@ -1656,6 +1656,7 @@ class Speedtest(object):
while _is_alive(thread): while _is_alive(thread):
thread.join(timeout=0.001) thread.join(timeout=0.001)
in_flight['threads'] -= 1 in_flight['threads'] -= 1
if type(thread.result) in (int, float):
finished.append(thread.result) finished.append(thread.result)
callback(thread.i, request_count, end=True) callback(thread.i, request_count, end=True)