From: W. Trevor King Date: Tue, 24 Apr 2012 20:01:17 +0000 (-0400) Subject: Always return a new Message instance from pgp.verify(). X-Git-Url: http://git.tremily.us/?a=commitdiff_plain;h=49802119d7846c7ffd6d72a46068aff014361b59;p=pgp-mime.git Always return a new Message instance from pgp.verify(). Now callers can mess with the result without worrying about mucking up the original message instance. `# --- diff --git a/pgp_mime/pgp.py b/pgp_mime/pgp.py index 8a7df52..22f1fa0 100644 --- a/pgp_mime/pgp.py +++ b/pgp_mime/pgp.py @@ -1,5 +1,6 @@ # Copyright +import copy as _copy from email import message_from_bytes as _message_from_bytes from email.encoders import encode_7or8bit as _encode_7or8bit from email.mime.application import MIMEApplication as _MIMEApplication @@ -518,4 +519,4 @@ def verify(message): sig_data = sig_data.encode('us-ascii') decrypted,verified,result = _verify_bytes( body.as_string().encode('us-ascii'), signature=sig_data) - return (body, verified, result) + return (_copy.deepcopy(body), verified, result)