From 5052f0e75b77c279484a74393f4ff6c55a07af7d Mon Sep 17 00:00:00 2001 From: Marion Date: Sat, 31 Aug 2013 20:41:05 +0000 Subject: fix export of keyword arguments to Primitives --- (limited to 'TurtleArt/tatype.py') diff --git a/TurtleArt/tatype.py b/TurtleArt/tatype.py index 477e028..3fa7a83 100644 --- a/TurtleArt/tatype.py +++ b/TurtleArt/tatype.py @@ -178,14 +178,16 @@ TYPE_CONVERTERS = { } -def get_call_ast(func_name, args=None, keywords=None): +def get_call_ast(func_name, args=None, kwargs=None): """ Return an AST representing the call to a function with the name func_name, passing it the arguments args (given as a list) and the - keyword arguments keywords (given as a dictionary). """ + keyword arguments kwargs (given as a dictionary). """ if args is None: args = [] - if keywords is None: - keywords = {} + keywords = [] + if kwargs is not None: + for (key, value) in kwargs.iteritems(): + keywords.append(ast.keyword(arg=key, value=value)) return ast.Call(func=ast.Name(id=func_name, ctx=ast.Load), args=args, -- cgit v0.9.1