Skip to content

Commit 2378a95

Browse files
Simplify fix: remove startswith check, restore unconditional wrapping
1 parent 6f22581 commit 2378a95

1 file changed

Lines changed: 0 additions & 4 deletions

File tree

Lib/smtplib.py

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -149,10 +149,6 @@ def quoteaddr(addrstring):
149149
displayname, addr = email.utils.parseaddr(addrstring)
150150
if (displayname, addr) == ('', ''):
151151
# parseaddr couldn't parse it, use it as is and hope for the best.
152-
if addrstring.strip().startswith('<'):
153-
if addrstring.strip().endswith('>'):
154-
return addrstring
155-
return addrstring.strip() + '>'
156152
return "<%s>" % addrstring
157153
return "<%s>" % addr
158154

0 commit comments

Comments
 (0)