From: W. Trevor King Date: Tue, 24 Apr 2012 20:11:57 +0000 (-0400) Subject: pgp_mime.pgp.verify() no longer needs deepcopy(). X-Git-Tag: v0.2~8 X-Git-Url: http://git.tremily.us/?a=commitdiff_plain;h=4160eb4d6f464e283319089f0ab05a7d95d32259;p=pygrader.git pgp_mime.pgp.verify() no longer needs deepcopy(). Since the pgp-mime commit: commit 49802119d7846c7ffd6d72a46068aff014361b59 Author: W. Trevor King Date: Tue Apr 24 16:01:17 2012 -0400 Always return a new Message instance from pgp.verify(). --- diff --git a/pygrader/mailpipe.py b/pygrader/mailpipe.py index efb8589..57ef2ff 100644 --- a/pygrader/mailpipe.py +++ b/pygrader/mailpipe.py @@ -305,7 +305,6 @@ def _check_late(basedir, assignment, person, time, max_late=0, use_color=None, def _get_verified_message(message, pgp_key, use_color=None): """ - >>> from copy import deepcopy >>> from pgp_mime import sign, encodedMIMEText The student composes a message... @@ -325,8 +324,7 @@ def _get_verified_message(message, pgp_key, use_color=None): We check that the message is signed, and that it is signed by the appropriate key. - >>> our_message = _get_verified_message( - ... deepcopy(signed), pgp_key='4332B6E3') + >>> our_message = _get_verified_message(signed, pgp_key='4332B6E3') >>> print(our_message.as_string()) # doctest: +REPORT_UDIFF Content-Type: text/plain; charset="us-ascii" MIME-Version: 1.0 @@ -340,14 +338,12 @@ def _get_verified_message(message, pgp_key, use_color=None): If it is signed, but not by the right key, we get ``None``. - >>> print(_get_verified_message( - ... deepcopy(signed), pgp_key='01234567')) + >>> print(_get_verified_message(signed, pgp_key='01234567')) None If it is not signed at all, we get ``None``. - >>> print(_get_verified_message( - ... deepcopy(message), pgp_key='4332B6E3')) + >>> print(_get_verified_message(message, pgp_key='4332B6E3')) None """ highlight,lowlight,good,bad = _standard_colors(use_color=use_color)