Skip to content

Commit

Permalink
List marshaling and py3 bug fix
Browse files Browse the repository at this point in the history
* Now using `items` instead of `iteritems` for iterating over dictionaries, as the latter is not supported in Py3
* UDF arguments can be marshalled as `"list"` so that rather than arriving as tuples or tuples of tuples, they arrive as lists or lists of lists.
* Now using `Application.PathSeparator` to calculate paths in the add-in, even though it shouldn't make any difference on any machine, for now.
  • Loading branch information
ericremoreynolds committed Sep 1, 2014
1 parent 069c494 commit 65cd324
Show file tree
Hide file tree
Showing 3 changed files with 3 additions and 3 deletions.
Binary file modified addin/xlpython.xlam
Binary file not shown.
4 changes: 2 additions & 2 deletions addin/xlpython/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -55,7 +55,7 @@ def xlret(marshal=None, **kwargs):
def inner(f):
xlf = xlfunc(f).__xlfunc__
xlr = xlf["ret"]
for k, v in kwargs.iteritems():
for k, v in kwargs.items():
if k in xlretparams:
xlr[k] = v
else:
Expand All @@ -74,7 +74,7 @@ def inner(f):
if arg not in xlf["argmap"]:
raise Exception("Invalid argument name '" + arg + "'.")
xla = xlf["argmap"][arg]
for k, v in kwargs.iteritems():
for k, v in kwargs.items():
if k in xlargparams:
xla[k] = v
else:
Expand Down
2 changes: 1 addition & 1 deletion addin/xlpython/xlpyserver.py
Original file line number Diff line number Diff line change
Expand Up @@ -131,7 +131,7 @@ def Var(self, obj, lax=False):
if lax:
t = type(value)
if t is dict:
value = tuple(value.iteritems())
value = tuple(value.items())
elif t.__name__ == 'ndarray' and t.__module__ == 'numpy':
value = value.tolist()
if type(value) is tuple:
Expand Down

0 comments on commit 65cd324

Please sign in to comment.