public inbox for cygwin-apps-cvs@sourceware.org help / color / mirror / Atom feed
From: Jon TURNEY <jturney@sourceware.org> To: cygwin-apps-cvs@sourceware.org Subject: [calm - Cygwin server-side packaging maintenance script] branch master, updated. 20220704-5-g4ef519f Date: Sat, 16 Jul 2022 19:12:33 +0000 (GMT) [thread overview] Message-ID: <20220716191234.000813858D39@sourceware.org> (raw) https://sourceware.org/git/gitweb.cgi?p=cygwin-apps/calm.git;h=4ef519f84b9da106f07677289f629787384cb469 commit 4ef519f84b9da106f07677289f629787384cb469 Author: Jon Turney <jon.turney@dronecode.org.uk> Date: Sat Jul 16 19:56:28 2022 +0100 Fix BufferingSMTPHandler used as a context Since a1cb1581, BufferingSMTPHandler was used directly as a context to send an unhandled exception termination report email, but that class doesn't support such use... Diff: --- calm/buffering_smtp_handler.py | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/calm/buffering_smtp_handler.py b/calm/buffering_smtp_handler.py index 2d764ae..2cd1b63 100644 --- a/calm/buffering_smtp_handler.py +++ b/calm/buffering_smtp_handler.py @@ -99,3 +99,10 @@ class BufferingSMTPHandler(logging.handlers.BufferingHandler): def __enter__(self): logging.getLogger().addHandler(self) return self + + def __exit__(self, exception_type, exception_value, traceback): + self.close() + logging.getLogger().removeHandler(self) + + # process any exception in the with-block normally + return False
reply other threads:[~2022-07-16 19:12 UTC|newest] Thread overview: [no followups] expand[flat|nested] mbox.gz Atom feed
Reply instructions: You may reply publicly to this message via plain-text email using any one of the following methods: * Save the following mbox file, import it into your mail client, and reply-to-all from there: mbox Avoid top-posting and favor interleaved quoting: https://en.wikipedia.org/wiki/Posting_style#Interleaved_style * Reply using the --to, --cc, and --in-reply-to switches of git-send-email(1): git send-email \ --in-reply-to=20220716191234.000813858D39@sourceware.org \ --to=jturney@sourceware.org \ --cc=cygwin-apps-cvs@sourceware.org \ /path/to/YOUR_REPLY https://kernel.org/pub/software/scm/git/docs/git-send-email.html * If your mail client supports setting the In-Reply-To header via mailto: links, try the mailto: linkBe sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions for how to clone and mirror all data and code used for this inbox; as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).