Skip to content

Commit

Permalink
corrected fix for builtins and fixes #390 UDF that return None
Browse files Browse the repository at this point in the history
  • Loading branch information
fzumstein committed Mar 22, 2016
1 parent 0f60f0b commit 3bec139
Show file tree
Hide file tree
Showing 4 changed files with 9 additions and 1 deletion.
2 changes: 1 addition & 1 deletion xlwings/__init__.py
Expand Up @@ -15,7 +15,7 @@
string_types = basestring
xrange = xrange
from future_builtins import map
import __builtins__ as builtins
builtins = __builtins__

# Platform specifics
if sys.platform.startswith('win'):
Expand Down
2 changes: 2 additions & 0 deletions xlwings/_xlwindows.py
Expand Up @@ -406,6 +406,8 @@ def prepare_xl_data_element(x):
return _datetime_to_com_time(x)
elif np and isinstance(x, np.generic):
return float(x)
elif x is None:
return ""
else:
return x

Expand Down
6 changes: 6 additions & 0 deletions xlwings/tests/udfs/udf_tests.py
Expand Up @@ -497,5 +497,11 @@ def optional_args(x, y=None):
y = 10
return x * y


@xw.func
def write_none():
return None


if __name__ == "__main__":
xw.serve()
Binary file modified xlwings/tests/udfs/udf_tests.xlsm
Binary file not shown.

0 comments on commit 3bec139

Please sign in to comment.