mirror of
https://github.com/tahoe-lafs/tahoe-lafs.git
synced 2024-12-29 17:28:53 +00:00
Okay, let KeyboardInterrupt through
This commit is contained in:
parent
895ba55cf7
commit
0ffbc7870e
@ -141,3 +141,16 @@ class Observer(unittest.TestCase):
|
||||
|
||||
self.assertEqual([None], observed)
|
||||
self.assertEqual(1, len(self.flushLoggedErrors(Exception)))
|
||||
|
||||
def test_observer_list_propagate_keyboardinterrupt(self):
|
||||
"""
|
||||
``KeyboardInterrupt`` escapes ``ObserverList.notify``.
|
||||
"""
|
||||
def observer_one():
|
||||
raise KeyboardInterrupt()
|
||||
|
||||
obs = observer.ObserverList()
|
||||
obs.subscribe(observer_one)
|
||||
|
||||
with self.assertRaises(KeyboardInterrupt):
|
||||
obs.notify()
|
||||
|
@ -118,7 +118,7 @@ class ObserverList(object):
|
||||
for o in self._watchers[:]:
|
||||
try:
|
||||
o(*args, **kwargs)
|
||||
except:
|
||||
except Exception:
|
||||
self._logger.failure("While notifying {o!r}", o=o)
|
||||
|
||||
class EventStreamObserver(object):
|
||||
|
Loading…
Reference in New Issue
Block a user