Lakin Smith has uploaded this change for review. ( https://gem5-review.googlesource.com/c/public/gem5/+/33556 )

Change subject: util: Allow pre-commit hook to parse unicode/nonASCII characters
......................................................................

util: Allow pre-commit hook to parse unicode/nonASCII characters

Set the default encoding in python to utf-8, this should be
removed when moving to Python3.

See:
https://stackoverflow.com/questions/3828723/why-should-we-not-use-sys-setdefaultencodingutf-8-in-a-py-script

Change-Id: I76ff6e573b9718d3023177bbd50b37a6ee3bc514
---
M util/style/verifiers.py
1 file changed, 5 insertions(+), 0 deletions(-)



diff --git a/util/style/verifiers.py b/util/style/verifiers.py
index 85f31ce..b639b5e 100644
--- a/util/style/verifiers.py
+++ b/util/style/verifiers.py
@@ -46,6 +46,11 @@
 import os
 import re
 import sys
+# Allow pre-commit hook to parse unicode/non-ASCII characters
+# by setting the python encoding to utf-8.
+# This should be removed when moving to Python3
+reload(sys)
+sys.setdefaultencoding('utf-8')

 from six import add_metaclass


--
To view, visit https://gem5-review.googlesource.com/c/public/gem5/+/33556
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: I76ff6e573b9718d3023177bbd50b37a6ee3bc514
Gerrit-Change-Number: 33556
Gerrit-PatchSet: 1
Gerrit-Owner: Lakin Smith <[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

Reply via email to