@@ -245,14 +245,6 @@ def __call__(self, intent):
245245 return sync_performer (lambda d , i : v (i ))
246246
247247
248- class IntentMismatchError (Exception ):
249- def __init__ (self , expected_intent , got_intent ):
250- self .expected_intent = expected_intent
251- self .got_intent = got_intent
252- super (IntentMismatchError , self ).__init__ (
253- 'Expected intent %r, got %r' % (expected_intent , got_intent ))
254-
255-
256248class SequenceDispatcher (object ):
257249 """
258250 A dispatcher which steps through a sequence of (intent, func) tuples and
@@ -266,10 +258,6 @@ class SequenceDispatcher(object):
266258 (MyIntent('a'), lambda i: 'my-intent-result'),
267259 (OtherIntent('b'), lambda i: 'other-intent-result')
268260 ])
269-
270- Unlike most dispatchers, this one raises an exception
271- (:obj:`IntentMismatchError`) when an intent is not found, in the order
272- expected.
273261 """
274262 def __init__ (self , sequence ):
275263 """:param list sequence: Sequence of (intent, fn)."""
@@ -280,5 +268,3 @@ def __call__(self, intent):
280268 if intent == exp_intent :
281269 self .sequence = self .sequence [1 :]
282270 return sync_performer (lambda d , i : func (i ))
283- else :
284- raise IntentMismatchError (exp_intent , intent )
0 commit comments