Andreas Sandberg has uploaded this change for review. (
https://gem5-review.googlesource.com/c/public/gem5/+/15995
Change subject: python: Switch from using compare to key in list sort
......................................................................
python: Switch from using compare to key in list sort
Python 3 has deprecated the use of a comparison function in favour of
a key extraction function.
Change-Id: I4b7eab791ecbdfbf7147f57fdbc7cbe8f1de20dd
Signed-off-by: Andreas Sandberg <andreas.sandb...@arm.com>
---
M src/python/m5/stats/__init__.py
1 file changed, 1 insertion(+), 6 deletions(-)
diff --git a/src/python/m5/stats/__init__.py
b/src/python/m5/stats/__init__.py
index 10184c2..019c7eb 100644
--- a/src/python/m5/stats/__init__.py
+++ b/src/python/m5/stats/__init__.py
@@ -177,12 +177,7 @@
if not (stat.flags & flags.display):
stat.name = "__Stat%06d" % stat.id
- def less(stat1, stat2):
- v1 = stat1.name.split('.')
- v2 = stat2.name.split('.')
- return v1 < v2
-
- stats_list.sort(less)
+ stats_list.sort(key=lambda s: s.name.split('.'))
for stat in stats_list:
stats_dict[stat.name] = stat
stat.enable()
--
To view, visit https://gem5-review.googlesource.com/c/public/gem5/+/15995
To unsubscribe, or for help writing mail filters, visit
https://gem5-review.googlesource.com/settings
Gerrit-Project: public/gem5
Gerrit-Branch: master
Gerrit-Change-Id: I4b7eab791ecbdfbf7147f57fdbc7cbe8f1de20dd
Gerrit-Change-Number: 15995
Gerrit-PatchSet: 1
Gerrit-Owner: Andreas Sandberg <andreas.sandb...@arm.com>
Gerrit-MessageType: newchange
_______________________________________________
gem5-dev mailing list
gem5-dev@gem5.org
http://m5sim.org/mailman/listinfo/gem5-dev