diff options
-rw-r--r-- | Lib/rfc822.py | 6 |
1 files changed, 3 insertions, 3 deletions
diff --git a/Lib/rfc822.py b/Lib/rfc822.py index 3d9e13f876..4f69b22aab 100644 --- a/Lib/rfc822.py +++ b/Lib/rfc822.py @@ -477,9 +477,9 @@ class Message: def unquote(str): """Remove quotes from a string.""" if len(str) > 1: - if str[0] == '"' and str[-1:] == '"': - return str[1:-1] - if str[0] == '<' and str[-1:] == '>': + if str.startswith('"') and str.endswith('"'): + return str[1:-1].replace('\\\\', '\\').replace('\\"', '"') + if str.startswith('<') and str.endswith('>'): return str[1:-1] return str |