Gabe Black has submitted this change. ( 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
Reviewed-on: https://gem5-review.googlesource.com/c/public/gem5/+/35941
Tested-by: kokoro <[email protected]>
Reviewed-by: Jason Lowe-Power <[email protected]>
Reviewed-by: Nikos Nikoleris <[email protected]>
Maintainer: Gabe Black <[email protected]>
---
M src/python/m5/util/code_formatter.py
1 file changed, 1 insertion(+), 1 deletion(-)

Approvals:
  Jason Lowe-Power: Looks good to me, approved
  Nikos Nikoleris: Looks good to me, approved
  Gabe Black: Looks good to me, approved
  kokoro: Regressions pass



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: 4
Gerrit-Owner: Gabe Black <[email protected]>
Gerrit-Reviewer: Andreas Sandberg <[email protected]>
Gerrit-Reviewer: Bobby R. Bruce <[email protected]>
Gerrit-Reviewer: Gabe Black <[email protected]>
Gerrit-Reviewer: Giacomo Travaglini <[email protected]>
Gerrit-Reviewer: Jason Lowe-Power <[email protected]>
Gerrit-Reviewer: Nikos Nikoleris <[email protected]>
Gerrit-Reviewer: kokoro <[email protected]>
Gerrit-MessageType: merged
_______________________________________________
gem5-dev mailing list -- [email protected]
To unsubscribe send an email to [email protected]
%(web_page_url)slistinfo%(cgiext)s/%(_internal_name)s

Reply via email to