From 513eace47d63161cabfd3cce82f3e075525b164a Mon Sep 17 00:00:00 2001 From: Simon Glass Date: Tue, 14 May 2019 15:53:50 -0600 Subject: 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 --- tools/patman/gitutil.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'tools/patman/gitutil.py') 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] -- cgit v1.1