Commit 72e24992 authored by Dom Sekotill's avatar Dom Sekotill
Browse files

correctly handle dicts with 2 values in _is_args_kwds

In generator.test_generator._is_args_kwds, the first subcondition
( len(obj) == 2 ) can match dicts with two items, in which case (unless
the keys for the two items happen to be 0 and 1) the second two
subconditions will raise KeyErrors. This is now treated in the same way
as a TypeError.
parent 9f520cda
Loading
Loading
Loading
Loading
+1 −1
Original line number Diff line number Diff line
@@ -138,7 +138,7 @@ class test_generator(object):
	def _is_args_kwds(cls, obj):
		try:
			return len(obj) == 2 and cls._is_args(obj[0]) and cls._is_args(obj[1])
		except (TypeError):
		except (TypeError, KeyError):
			return False