[testsuite] Fixed infinite iteration in CaseMeta.__new__

The loop condition in the variable expansion loop was faulty and caused an
infinite loop when no change occured (i.e. no variables were expanded)
This commit is contained in:
Dan Čermák 2018-04-24 23:41:49 +02:00
parent 368771f3fd
commit fe98936375

View File

@ -598,13 +598,15 @@ class CaseMeta(type):
def __new__(mcs, clsname, bases, dct):
changed = False
changed = True
# expand all non-private variables by brute force
# => try all expanding all elements defined in the current class until
# there is no change in them any more
keys = [key for key in list(dct.keys()) if not key.startswith('_')]
while not changed:
while changed:
changed = False
for key in keys:
old_value = dct[key]