X-Git-Url: http://git.onelab.eu/?p=sfa.git;a=blobdiff_plain;f=sfatables%2Fcommands%2Fmoo.py;h=3860e3cd23d76182b345dc7bd026df66505b0575;hp=65b7598e2458e9b1a71f40a4dc30cef0af5cdd97;hb=4a9e6751f9f396f463932133b9d62fc925a99ef6;hpb=648ac3fd865ea29425485f26eb0a7bf1a62281e0 diff --git a/sfatables/commands/moo.py b/sfatables/commands/moo.py index 65b7598e..3860e3cd 100644 --- a/sfatables/commands/moo.py +++ b/sfatables/commands/moo.py @@ -59,7 +59,7 @@ class Command: # Indent struct fields and mixed types if isinstance(param, dict): - for name, subparam in param.iteritems(): + for name, subparam in param.items(): text += param_text(name, subparam, indent + step, step) elif isinstance(param, Mixed): for subparam in param: @@ -92,8 +92,8 @@ class Command: """ # Inspect call. Remove self from the argument list. - max_args = self.call.func_code.co_varnames[1:self.call.func_code.co_argcount] - defaults = self.call.func_defaults + max_args = self.call.__code__.co_varnames[1:self.call.__code__.co_argcount] + defaults = self.call.__defaults__ if defaults is None: defaults = () @@ -199,13 +199,13 @@ class Command: # If a struct with particular (or required) types of items is # expected. elif isinstance(expected, dict): - for key in value.keys(): + for key in list(value.keys()): if key in expected: self.type_check(name + "['%s']" % key, value[key], expected[key], args) - for key, subparam in expected.iteritems(): + for key, subparam in expected.items(): if isinstance(subparam, Parameter) and \ subparam.optional is not None and \ - not subparam.optional and key not in value.keys(): + not subparam.optional and key not in list(value.keys()): raise SfaInvalidArgument("'%s' not specified" % key, name) #if auth is not None: