summaryrefslogtreecommitdiffstats
path: root/Lib/logging/__init__.py
diff options
context:
space:
mode:
authorVinay Sajip <vinay_sajip@yahoo.co.uk>2012-10-09 07:06:13 (GMT)
committerVinay Sajip <vinay_sajip@yahoo.co.uk>2012-10-09 07:06:13 (GMT)
commit8cf4eb1463217095e9276c0caacfb2df9372504f (patch)
tree026ba0deb3d3839450766c501c6769982f25566c /Lib/logging/__init__.py
parent85aa0118dbe0caf704d6c5de94ddcf7f4dcba32c (diff)
downloadcpython-8cf4eb1463217095e9276c0caacfb2df9372504f.zip
cpython-8cf4eb1463217095e9276c0caacfb2df9372504f.tar.gz
cpython-8cf4eb1463217095e9276c0caacfb2df9372504f.tar.bz2
Issue #16141: replaced old-style exception handling code in logging with the modern idiom.
Diffstat (limited to 'Lib/logging/__init__.py')
-rw-r--r--Lib/logging/__init__.py8
1 files changed, 3 insertions, 5 deletions
diff --git a/Lib/logging/__init__.py b/Lib/logging/__init__.py
index e79018f..0f804ae 100644
--- a/Lib/logging/__init__.py
+++ b/Lib/logging/__init__.py
@@ -67,7 +67,7 @@ else: #pragma: no cover
"""Return the frame object for the caller's stack frame."""
try:
raise Exception
- except:
+ except Exception:
return sys.exc_info()[2].tb_frame.f_back
# _srcfile is only used in conjunction with sys._getframe().
@@ -938,9 +938,7 @@ class StreamHandler(Handler):
stream.write(msg)
stream.write(self.terminator)
self.flush()
- except (KeyboardInterrupt, SystemExit): #pragma: no cover
- raise
- except:
+ except Exception:
self.handleError(record)
class FileHandler(StreamHandler):
@@ -1837,7 +1835,7 @@ def shutdown(handlerList=_handlerList):
pass
finally:
h.release()
- except:
+ except: # ignore everything, as we're shutting down
if raiseExceptions:
raise
#else, swallow