Skip to content

Commit

Permalink
device-crash-test: Python 3 compatibility fix
Browse files Browse the repository at this point in the history
Restrict whitelist entry stats in debug mode to be sorted only by
"count", since Python 3 does not implicitly support comparing
dictionaries.

Signed-off-by: Nisarg Shah <nshah@disroot.org>
Message-Id: <20190116183358.30287-1-nshah@disroot.org>
[ehabkost: removed 2 unnecessary hunks from patch]
[ehabkost: edited commit message]
Signed-off-by: Eduardo Habkost <ehabkost@redhat.com>
  • Loading branch information
Nisarg Shah authored and ehabkost committed Jan 25, 2019
1 parent 9dd0d81 commit 55e0a34
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion scripts/device-crash-test
Original file line number Diff line number Diff line change
Expand Up @@ -557,7 +557,8 @@ def main():
logger.info("Skipped %d test cases", skipped)

if args.debug:
stats = sorted([(len(wl_stats.get(i, [])), wl) for i, wl in enumerate(ERROR_WHITELIST)])
stats = sorted([(len(wl_stats.get(i, [])), wl) for i, wl in
enumerate(ERROR_WHITELIST)], key=lambda x: x[0])
for count, wl in stats:
dbg("whitelist entry stats: %d: %r", count, wl)

Expand Down

0 comments on commit 55e0a34

Please sign in to comment.