diff options
author | Neal Norwitz <nnorwitz@gmail.com> | 2006-02-05 08:21:08 (GMT) |
---|---|---|
committer | Neal Norwitz <nnorwitz@gmail.com> | 2006-02-05 08:21:08 (GMT) |
commit | 55cd82fe0adc0a7ceb93eb1b6e9de6a25fd7adb9 (patch) | |
tree | 2570a8e862a3e9a7fe6c49f0728d5a390a417558 /Lib/logging/__init__.py | |
parent | 0e6bc8c260f640ceee515e9873353778472e0a00 (diff) | |
download | cpython-55cd82fe0adc0a7ceb93eb1b6e9de6a25fd7adb9.zip cpython-55cd82fe0adc0a7ceb93eb1b6e9de6a25fd7adb9.tar.gz cpython-55cd82fe0adc0a7ceb93eb1b6e9de6a25fd7adb9.tar.bz2 |
Get test_logging to not hang when running under regrtest.py -R ::
Not sure why/how _handlers/_handlerList is out of sync. This could
indicate a deeper problem.
In test_logging, the only absolutely necessary change to get working
was tcpserver.abort = 1. But we don't want to wait infinitely
to join the threads, so give a 2.0 second timeout.
There doesn't appear to be a need for a local abort variable
in serve_until_stopped, so just use the instance member.
Note the problem is only on HEAD, not in 2.4.
Diffstat (limited to 'Lib/logging/__init__.py')
-rw-r--r-- | Lib/logging/__init__.py | 3 |
1 files changed, 2 insertions, 1 deletions
diff --git a/Lib/logging/__init__.py b/Lib/logging/__init__.py index 5a0b0f5..9fa8797 100644 --- a/Lib/logging/__init__.py +++ b/Lib/logging/__init__.py @@ -671,7 +671,8 @@ class Handler(Filterer): #get the module data lock, as we're updating a shared structure. _acquireLock() try: #unlikely to raise an exception, but you never know... - del _handlers[self] + if _handlers.has_key(self): + del _handlers[self] _handlerList.remove(self) finally: _releaseLock() |