diff options
author | Vinay Sajip <vinay_sajip@yahoo.co.uk> | 2004-07-29 09:19:30 (GMT) |
---|---|---|
committer | Vinay Sajip <vinay_sajip@yahoo.co.uk> | 2004-07-29 09:19:30 (GMT) |
commit | e12f71586ac4d3387fa635dd6617b4f8ebed083a (patch) | |
tree | 3759565be54a0823dd34d6442d97a2565e19f215 /Lib/logging | |
parent | f9fd0d7988c5f4c69952e7bb9245319424beccf9 (diff) | |
download | cpython-e12f71586ac4d3387fa635dd6617b4f8ebed083a.zip cpython-e12f71586ac4d3387fa635dd6617b4f8ebed083a.tar.gz cpython-e12f71586ac4d3387fa635dd6617b4f8ebed083a.tar.bz2 |
Ignore exceptions which occur when closing files in shutdown()
Diffstat (limited to 'Lib/logging')
-rw-r--r-- | Lib/logging/__init__.py | 9 |
1 files changed, 7 insertions, 2 deletions
diff --git a/Lib/logging/__init__.py b/Lib/logging/__init__.py index e9bcf33..8c63160 100644 --- a/Lib/logging/__init__.py +++ b/Lib/logging/__init__.py @@ -1256,8 +1256,13 @@ def shutdown(): Should be called at application exit. """ for h in _handlers.keys(): - h.flush() - h.close() + #errors might occur, for example, if files are locked + #we just ignore them + try: + h.flush() + h.close() + except: + pass #Let's try and shutdown automatically on application exit... try: |