mirror of
https://github.com/python/cpython.git
synced 2025-09-26 18:29:57 +00:00
Replace rfc822.parseaddr with email.Utils.parseaddr. The implementation is
still the same, so there should be no backwards-compatibility problems.
This commit is contained in:
parent
c7fc10a418
commit
9a98364ba3
1 changed files with 2 additions and 2 deletions
|
@ -43,7 +43,7 @@ Example:
|
||||||
|
|
||||||
import socket
|
import socket
|
||||||
import re
|
import re
|
||||||
import rfc822
|
import email.Utils
|
||||||
import base64
|
import base64
|
||||||
import hmac
|
import hmac
|
||||||
from email.base64MIME import encode as encode_base64
|
from email.base64MIME import encode as encode_base64
|
||||||
|
@ -171,7 +171,7 @@ def quoteaddr(addr):
|
||||||
"""
|
"""
|
||||||
m = (None, None)
|
m = (None, None)
|
||||||
try:
|
try:
|
||||||
m=rfc822.parseaddr(addr)[1]
|
m = email.Utils.parseaddr(addr)[1]
|
||||||
except AttributeError:
|
except AttributeError:
|
||||||
pass
|
pass
|
||||||
if m == (None, None): # Indicates parse failure or AttributeError
|
if m == (None, None): # Indicates parse failure or AttributeError
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue