Gabe Black has uploaded this change for review. (
https://gem5-review.googlesource.com/c/public/gem5/+/35941 )
Change subject: python: Remove a call to reduce() from code_formatter.py.
......................................................................
python: Remove a call to reduce() from code_formatter.py.
The built in reduce method is no longer available in python 3. Besides
that, this particular bit of code is simpler and easier to read if
reduce is replaced with the also built in sum() method.
Change-Id: I6daca42494ea0534721dfcfb1f6058517cd482d9
---
M src/python/m5/util/code_formatter.py
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/src/python/m5/util/code_formatter.py
b/src/python/m5/util/code_formatter.py
index f441df0..37880de 100644
--- a/src/python/m5/util/code_formatter.py
+++ b/src/python/m5/util/code_formatter.py
@@ -266,7 +266,7 @@
lineno = 1
else:
lines = format[:i].splitlines(True)
- colno = i - reduce(lambda x,y: x+y, (len(z) for z in
lines))
+ colno = i - sum(len(z) for z in lines)
lineno = len(lines)
raise ValueError('Invalid format string: line %d, col %d' %
--
To view, visit https://gem5-review.googlesource.com/c/public/gem5/+/35941
To unsubscribe, or for help writing mail filters, visit
https://gem5-review.googlesource.com/settings
Gerrit-Project: public/gem5
Gerrit-Branch: develop
Gerrit-Change-Id: I6daca42494ea0534721dfcfb1f6058517cd482d9
Gerrit-Change-Number: 35941
Gerrit-PatchSet: 1
Gerrit-Owner: Gabe Black <[email protected]>
Gerrit-MessageType: newchange
_______________________________________________
gem5-dev mailing list -- [email protected]
To unsubscribe send an email to [email protected]
%(web_page_url)slistinfo%(cgiext)s/%(_internal_name)s