Skip to content

Commit a3a99a2

Browse files
committed
Pull request #255: Bugfix/431633 inspect args
Merge in LCL/wolframclientforpython from bugfix/431633-inspect-args to master * commit 'e8b876c08d80c6ffeb1fb81cd3a35877f144aa40': version bump depending on the system getfullargspec might not be there
2 parents a924aa5 + e8b876c commit a3a99a2

File tree

3 files changed

+11
-3
lines changed

3 files changed

+11
-3
lines changed

PacletInfo.m

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
Paclet[
22
Name -> "WolframClientForPython",
3-
Version -> "1.1.8",
3+
Version -> "1.1.9",
44
MathematicaVersion -> "12.3+",
55
Loading -> Automatic,
66
Extensions -> {}

wolframclient/about.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,6 @@
22

33
__name__ = "wolframclient"
44
__description__ = "A Python library with various tools to interact with the Wolfram Language and the Wolfram Cloud."
5-
__version__ = "1.1.8"
5+
__version__ = "1.1.9"
66
__author__ = "Wolfram Research"
77

wolframclient/serializers/base.py

Lines changed: 9 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -15,6 +15,14 @@
1515
from wolframclient.utils.encoding import concatenate_bytes, force_text
1616
from 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

1927
class 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

0 commit comments

Comments
 (0)