Skip to content

Commit 3ba825b

Browse files
Fix Command.__call__ to comply w/its new intention
Delegate to .check_output() instead of .check_call() Take cmdargs as *varargs in contrast to the standard methods for starting the subprocesss, so that it feels more Pythonic
1 parent 56f8191 commit 3ba825b

1 file changed

Lines changed: 7 additions & 3 deletions

File tree

nodely/bin.py

Lines changed: 7 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -209,9 +209,13 @@ def check_output(self, cmdargs=None, **options):
209209

210210
return out
211211

212-
def __call__(self, cmdargs=None, **kwargs):
213-
"""Alternative to :meth:`.check_output`."""
214-
return self.check_call(cmdargs, **kwargs)
212+
def __call__(self, *cmdargs, **kwargs):
213+
"""
214+
Alternative to :meth:`.check_output`.
215+
216+
Takes `cmdargs` as varargs instead of a sequence parameter
217+
"""
218+
return self.check_output(cmdargs, **kwargs)
215219

216220
def __repr__(self):
217221
return "{}[{!r}]".format(__name__, self.name)

0 commit comments

Comments
 (0)