From 49802119d7846c7ffd6d72a46068aff014361b59 Mon Sep 17 00:00:00 2001 From: "W. Trevor King" Date: Tue, 24 Apr 2012 16:01:17 -0400 Subject: [PATCH] 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. `# --- pgp_mime/pgp.py | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) 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) -- 2.26.2