You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Pull request #272: adding a fix for file descriptor
Merge in LCL/wolframclientforpython from bugfix/file-descriptor to master
* commit '3ca6aab0f6650cd00fa2e75b3a74bfa082de26e5':
adding a fix for file descriptor
from __future__ importabsolute_import, print_function, unicode_literals
2
+
3
+
importio
4
+
5
+
fromwolframclient.utils.dispatchimportDispatch
6
+
7
+
encoder=Dispatch()
8
+
9
+
@encoder.dispatch(io.IOBase.__mro__)
10
+
defencode_quantity(serializer, o):
11
+
12
+
# we need to patch io objects because we automatically attempt to convert classes that are iterable to a list, however it should not be done in this case. To be improved.
13
+
14
+
ifserializer.object_processor:
15
+
returnserializer.object_processor(serializer, o)
16
+
17
+
raiseNotImplementedError("Cannot serialize object of class %s"%o.__class__)
0 commit comments