mercurial/mail.py
changeset 37469 7edf68862fe3
parent 37463 bbd240f81ac5
child 38332 7b12a2d2eedc
--- a/mercurial/mail.py	Sun Apr 08 15:03:00 2018 +0900
+++ b/mercurial/mail.py	Sun Apr 08 15:22:30 2018 +0900
@@ -332,6 +332,11 @@
                 continue
             except UnicodeDecodeError:
                 pass
+        # On Python 3, decode_header() may return either bytes or unicode
+        # depending on whether the header has =?<charset>? or not
+        if isinstance(part, type(u'')):
+            uparts.append(part)
+            continue
         try:
             uparts.append(part.decode('UTF-8'))
             continue