File tree Expand file tree Collapse file tree
wolframclient/serializers Expand file tree Collapse file tree Original file line number Diff line number Diff line change 1515from wolframclient .utils .encoding import concatenate_bytes , force_text
1616from wolframclient .utils .functional import first
1717
18+ if hasattr (inspect , 'getfullargspec' ):
19+ inspect_args = inspect .getfullargspec
20+ elif hasattr (inspect , 'getargspec' ):
21+ inspect_args = inspect .getargspec
22+ else :
23+ def inspect_args (f ):
24+ raise TypeError ()
25+
1826
1927class FormatSerializer (Encoder ):
2028 def generate_bytes (self , data ):
@@ -139,7 +147,7 @@ def _serialize_external_object(self, o):
139147 yield "Type" , "PythonFunction"
140148 try :
141149 # force tuple to avoid calling this method again on `map`.
142- yield "Arguments" , tuple (map (force_text , first (inspect . getargspec (o ))))
150+ yield "Arguments" , tuple (map (force_text , first (inspect_args (o ))))
143151 except TypeError :
144152 # this function can fail with TypeError unsupported callable
145153 pass
You can’t perform that action at this time.
0 commit comments