Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Commit 135cc47

Browse files
committed
Fix handling of nargout for python 2
1 parent 8eab630 commit 135cc47

File tree

1 file changed

+3
-2
lines changed

1 file changed

+3
-2
lines changed

pymatbridge/pymatbridge.py

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -265,7 +265,7 @@ def is_function_processor_working(self):
265265
def _json_response(self, **kwargs):
266266
return json.loads(self._response(**kwargs), object_hook=decode_pymat)
267267

268-
def run_func(self, func_path, *args, nargout=1, **kwargs):
268+
def run_func(self, func_path, *args, **kwargs):
269269
"""Run a function in Matlab and return the result.
270270
271271
Parameters
@@ -285,6 +285,7 @@ def run_func(self, func_path, *args, nargout=1, **kwargs):
285285
-------
286286
Result dictionary with keys: 'message', 'result', and 'success'
287287
"""
288+
nargout = kwargs.pop('nargout', 1)
288289
args += tuple(item for pair in zip(kwargs.keys(), kwargs.values())
289290
for item in pair)
290291
return self._json_response(cmd='run_function',
@@ -522,7 +523,7 @@ def __init__(self, parent, name):
522523
self._parent = parent
523524
self.doc = None
524525

525-
def __call__(self, unused_parent_weakref, *args, nargout=1, **kwargs):
526+
def __call__(self, unused_parent_weakref, *args, **kwargs):
526527
"""Call a function with the supplied arguments in the Matlab subprocess
527528
528529
Passes parameters to `run_func`.

0 commit comments

Comments
 (0)