We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
1 parent 10380e2 commit 472a3edCopy full SHA for 472a3ed
ietf/utils/mail.py
@@ -227,8 +227,8 @@ def parseaddr(addr):
227
which case a 2-tuple of ('', '') is returned.
228
229
"""
230
- if not isinstance(addr, str):
231
- addr = ''.join( [ s.decode(m) if m else s.decode() for (s,m) in decode_header(addr) ] )
+
+ addr = ''.join( [ ( s.decode(m) if m else s.decode()) if isinstance(s, bytes) else s for (s,m) in decode_header(addr) ] )
232
name, addr = simple_parseaddr(addr)
233
return name, addr
234
0 commit comments