Skip to content

Commit

Permalink
Avoid using itertools.permutations in k5test
Browse files Browse the repository at this point in the history
k5test is only supposed to require Python 2.4, but cross_realms uses
itertools.permutations which is new in 2.6.  Use a list display
instead.

ticket: 7054

git-svn-id: svn://anonsvn.mit.edu/krb5/trunk@25592 dc483132-0cff-0310-8789-dd5450dbe970
  • Loading branch information
greghudson committed Dec 17, 2011
1 parent e946963 commit 2240347
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions src/util/k5test.py
Original file line number Diff line number Diff line change
Expand Up @@ -314,7 +314,6 @@
"""

import atexit
import itertools
import optparse
import os
import shlex
Expand Down Expand Up @@ -979,7 +978,8 @@ def cross_realms(num, xtgts=None, args=None, **keywords):

if xtgts is None:
# Default to cross tgts for every pair of realms.
xtgts = frozenset(itertools.permutations(range(num), 2))
# (itertools.permutations would work here but is new in 2.6.)
xtgts = [(x,y) for x in range(num) for y in range(num) if x != y]

# Create the realms.
realms = []
Expand Down

0 comments on commit 2240347

Please sign in to comment.