Skip to content

Commit 245a5ab

Browse files
committed
Exception handling now raises KeyboardInterrupt and SystemExit rather than passing to handleError
1 parent 85c1909 commit 245a5ab

1 file changed

Lines changed: 6 additions & 0 deletions

File tree

Lib/logging/handlers.py

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -725,6 +725,8 @@ def emit(self, record):
725725
formatdate(), msg)
726726
smtp.sendmail(self.fromaddr, self.toaddrs, msg)
727727
smtp.quit()
728+
except (KeyboardInterrupt, SystemExit):
729+
raise
728730
except:
729731
self.handleError(record)
730732

@@ -810,6 +812,8 @@ def emit(self, record):
810812
type = self.getEventType(record)
811813
msg = self.format(record)
812814
self._welu.ReportEvent(self.appname, id, cat, type, [msg])
815+
except (KeyboardInterrupt, SystemExit):
816+
raise
813817
except:
814818
self.handleError(record)
815819

@@ -885,6 +889,8 @@ def emit(self, record):
885889
if self.method == "POST":
886890
h.send(data)
887891
h.getreply() #can't do anything with the result
892+
except (KeyboardInterrupt, SystemExit):
893+
raise
888894
except:
889895
self.handleError(record)
890896

0 commit comments

Comments
 (0)