aboutsummaryrefslogtreecommitdiff
path: root/tools/patman/gitutil.py
diff options
context:
space:
mode:
authorSimon Glass <sjg@chromium.org>2019-05-14 15:53:50 -0600
committerSimon Glass <sjg@chromium.org>2019-07-10 16:52:58 -0600
commit513eace47d63161cabfd3cce82f3e075525b164a (patch)
tree912b530a6efc46823f3e2f6e9894b0a5cb09e386 /tools/patman/gitutil.py
parentade1e3864f1508ad0ccbce72a39d815c2d7d7c87 (diff)
downloadu-boot-513eace47d63161cabfd3cce82f3e075525b164a.zip
u-boot-513eace47d63161cabfd3cce82f3e075525b164a.tar.gz
u-boot-513eace47d63161cabfd3cce82f3e075525b164a.tar.bz2
patman: Move unicode helpers to tools
Create helper functions in the tools module to deal with the differences between unicode in Python 2 (where we use the 'unicode' type) and Python 3 (where we use the 'str' type). Signed-off-by: Simon Glass <sjg@chromium.org>
Diffstat (limited to 'tools/patman/gitutil.py')
-rw-r--r--tools/patman/gitutil.py4
1 files changed, 2 insertions, 2 deletions
diff --git a/tools/patman/gitutil.py b/tools/patman/gitutil.py
index 11aeb73..fb9e67c 100644
--- a/tools/patman/gitutil.py
+++ b/tools/patman/gitutil.py
@@ -12,6 +12,7 @@ import terminal
import checkpatch
import settings
+import tools
# True to use --no-decorate - we check this in Setup()
use_no_decorate = True
@@ -325,9 +326,8 @@ def BuildEmailList(in_list, tag=None, alias=None, raise_on_error=True):
raw += LookupEmail(item, alias, raise_on_error=raise_on_error)
result = []
for item in raw:
+ item = tools.FromUnicode(item)
if not item in result:
- if type(item) == unicode:
- item = item.encode('utf-8')
result.append(item)
if tag:
return ['%s %s%s%s' % (tag, quote, email, quote) for email in result]