# HG changeset patch # Parent 65e5ffddd96a63f74aed1030c51d03396aed7f7d diff --git a/Lib/test/test_extcall.py b/Lib/test/test_extcall.py --- a/Lib/test/test_extcall.py +++ b/Lib/test/test_extcall.py @@ -127,6 +127,26 @@ >>> g(*Nothing()) 0 (1, 2, 3) {} +Stararg iterator raises TypeError. Make sure this error is propagated. + + >>> class Nothing: + ... def __init__(self): self.c = 0 + ... def __iter__(self): return self + ... def __next__(self): + ... if self.c == 4: + ... raise StopIteration + ... if self.c == 2: + ... raise TypeError('this iterator was a fake') + ... c = self.c + ... self.c += 1 + ... return c + ... + + >>> g(*Nothing()) + Traceback (most recent call last): + ... + TypeError: this iterator was a fake + Make sure that the function doesn't stomp the dictionary >>> d = {'a': 1, 'b': 2, 'c': 3}