Skip to content

Commit 6468dda

Browse files
committed
fix don't fail if --count is None
1 parent b0f7c4e commit 6468dda

File tree

1 file changed

+6
-2
lines changed

1 file changed

+6
-2
lines changed

mp_reader/analyzer.py

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -709,9 +709,13 @@ def type_stats(
709709
# Apply the filter to the sorted types
710710
sorted_types = [s for s in sorted_types if type_filter(record.get_type_name(s[-1]))]
711711

712-
n_omitted_matches = len(sorted_types) - count
712+
if count is not None:
713+
n_omitted_matches = len(sorted_types) - count
714+
sorted_types = sorted_types[:count]
715+
else:
716+
n_omitted_matches = 0
713717

714-
for _, _, _, tid in sorted_types[:count]:
718+
for _, _, _, tid in sorted_types:
715719
get_stats_for_type(
716720
tid,
717721
record,

0 commit comments

Comments
 (0)