summaryrefslogtreecommitdiff
path: root/tools/patman
diff options
context:
space:
mode:
authorSimon Glass <sjg@chromium.org>2019-05-14 15:53:54 -0600
committerSimon Glass <sjg@chromium.org>2019-07-10 16:52:58 -0600
commitf6a6aafceb74b496f6f8aaec908cd91b35252fbf (patch)
tree5f76ce282e3eb321f347c69fd72a4769b679cfda /tools/patman
parente6dca5e8f8d4160a6efed05f5275426e2d274542 (diff)
patman: Tidy up a few more unicode conversions
Use the new functions in the tools module to handle conversion. Signed-off-by: Simon Glass <sjg@chromium.org>
Diffstat (limited to 'tools/patman')
-rw-r--r--tools/patman/gitutil.py4
-rw-r--r--tools/patman/series.py5
2 files changed, 3 insertions, 6 deletions
diff --git a/tools/patman/gitutil.py b/tools/patman/gitutil.py
index fb9e67c0f0..dce7fa25b6 100644
--- a/tools/patman/gitutil.py
+++ b/tools/patman/gitutil.py
@@ -412,9 +412,7 @@ def EmailPatches(series, cover_fname, args, dry_run, raise_on_error, cc_fname,
if smtp_server:
cmd.append('--smtp-server=%s' % smtp_server)
if in_reply_to:
- if type(in_reply_to) != str:
- in_reply_to = in_reply_to.encode('utf-8')
- cmd.append('--in-reply-to="%s"' % in_reply_to)
+ cmd.append('--in-reply-to="%s"' % tools.FromUnicode(in_reply_to))
if thread:
cmd.append('--thread')
diff --git a/tools/patman/series.py b/tools/patman/series.py
index bbb30d849e..67103f03e6 100644
--- a/tools/patman/series.py
+++ b/tools/patman/series.py
@@ -239,7 +239,7 @@ class Series(dict):
for x in set(cc) & set(settings.bounces):
print(col.Color(col.YELLOW, 'Skipping "%s"' % x))
cc = set(cc) - set(settings.bounces)
- cc = [m.encode('utf-8') if type(m) != str else m for m in cc]
+ cc = [tools.FromUnicode(m) for m in cc]
if limit is not None:
cc = cc[:limit]
all_ccs += cc
@@ -248,8 +248,7 @@ class Series(dict):
if cover_fname:
cover_cc = gitutil.BuildEmailList(self.get('cover_cc', ''))
- cover_cc = [m.encode('utf-8') if type(m) != str else m
- for m in cover_cc]
+ cover_cc = [tools.FromUnicode(m) for m in cover_cc]
cc_list = ', '.join([tools.ToUnicode(x)
for x in sorted(set(cover_cc + all_ccs))])
print(cover_fname, cc_list.encode('utf-8'), file=fd)