diff options
Diffstat (limited to 'Lib/test/test_extcall.py')
-rw-r--r-- | Lib/test/test_extcall.py | 15 |
1 files changed, 4 insertions, 11 deletions
diff --git a/Lib/test/test_extcall.py b/Lib/test/test_extcall.py index 274e943..9effac7 100644 --- a/Lib/test/test_extcall.py +++ b/Lib/test/test_extcall.py @@ -1,14 +1,6 @@ -from test_support import verify, verbose, TestFailed +from test_support import verify, verbose, TestFailed, sortdict from UserList import UserList -def sortdict(d): - keys = d.keys() - keys.sort() - lst = [] - for k in keys: - lst.append("%r: %r" % (k, d[k])) - return "{%s}" % ", ".join(lst) - def f(*a, **k): print a, sortdict(k) @@ -228,8 +220,9 @@ for args in ['', 'a', 'ab']: lambda x: '%s="%s"' % (x, x), defargs) if vararg: arglist.append('*' + vararg) if kwarg: arglist.append('**' + kwarg) - decl = 'def %s(%s): print "ok %s", a, b, d, e, v, k' % ( - name, ', '.join(arglist), name) + decl = (('def %s(%s): print "ok %s", a, b, d, e, v, ' + + 'type(k) is type ("") and k or sortdict(k)') + % (name, ', '.join(arglist), name)) exec(decl) func = eval(name) funcs.append(func) |