diff options
| author | Vinay Sajip <vinay_sajip@yahoo.co.uk> | 2011-03-08 22:49:57 +0000 |
|---|---|---|
| committer | Vinay Sajip <vinay_sajip@yahoo.co.uk> | 2011-03-08 22:49:57 +0000 |
| commit | c8ab6eeb01ef01d8a630cbf177b06cece326be54 (patch) | |
| tree | 003792e6304ea92db39f10105fc52b55b727d820 | |
| parent | 49d7149e6d12ee878fcf30d703150a5d00f3908d (diff) | |
| download | cpython-git-c8ab6eeb01ef01d8a630cbf177b06cece326be54.tar.gz | |
Issue #11444: Lock handlers while flushing/closing during shutdown.
| -rw-r--r-- | Lib/logging/__init__.py | 3 |
1 files changed, 3 insertions, 0 deletions
diff --git a/Lib/logging/__init__.py b/Lib/logging/__init__.py index b555bbefd3..685efeb4a8 100644 --- a/Lib/logging/__init__.py +++ b/Lib/logging/__init__.py @@ -1507,12 +1507,15 @@ def shutdown(handlerList=_handlerList): #errors might occur, for example, if files are locked #we just ignore them if raiseExceptions is not set try: + h.acquire() h.flush() h.close() except: if raiseExceptions: raise #else, swallow + finally: + h.release() #Let's try and shutdown automatically on application exit... try: |
