Web   ·   Wiki   ·   Activities   ·   Blog   ·   Lists   ·   Chat   ·   Meeting   ·   Bugs   ·   Git   ·   Translate   ·   Archive   ·   People   ·   Donate
summaryrefslogtreecommitdiffstats
path: root/TurtleArt/tatype.py
diff options
context:
space:
mode:
authorMarion <marion.zepf@gmail.com>2013-08-31 20:41:05 (GMT)
committer Marion <marion.zepf@gmail.com>2013-08-31 20:41:05 (GMT)
commit5052f0e75b77c279484a74393f4ff6c55a07af7d (patch)
treef710cc4870a27c4a4131459a9733d1a966d07d46 /TurtleArt/tatype.py
parentb824b27903c7fb01e1880551a0d8ed1eea187bf4 (diff)
fix export of keyword arguments to Primitives
Diffstat (limited to 'TurtleArt/tatype.py')
-rw-r--r--TurtleArt/tatype.py10
1 files changed, 6 insertions, 4 deletions
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,