public inbox for cygwin-apps-cvs@sourceware.org
help / color / mirror / Atom feed
* [calm - Cygwin server-side packaging maintenance script] branch master, updated. 20220704-5-g4ef519f
@ 2022-07-16 19:12 Jon TURNEY
0 siblings, 0 replies; only message in thread
From: Jon TURNEY @ 2022-07-16 19:12 UTC (permalink / raw)
To: cygwin-apps-cvs
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
^ permalink raw reply [flat|nested] only message in thread
only message in thread, other threads:[~2022-07-16 19:12 UTC | newest]
Thread overview: (only message) (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2022-07-16 19:12 [calm - Cygwin server-side packaging maintenance script] branch master, updated. 20220704-5-g4ef519f Jon TURNEY
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).