Skip to content

Commit

Permalink
Allow customizing the RunningCommand class. Refs #604
Browse files Browse the repository at this point in the history
  • Loading branch information
Erik Cederstrand committed Aug 4, 2022
1 parent faa3cef commit 36c3d19
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion sh.py
Original file line number Diff line number Diff line change
Expand Up @@ -1161,6 +1161,7 @@ class Command(object):
RunningCommand object, which represents the Command put into an execution
state. """
thread_local = threading.local()
RunningCommandCls = RunningCommand

_call_args = {
"fg": False, # run command in foreground
Expand Down Expand Up @@ -1521,7 +1522,7 @@ def __call__(self, *args, **kwargs):
if output_redirect_is_filename(stderr):
stderr = open(str(stderr), "wb")

return RunningCommand(cmd, call_args, stdin, stdout, stderr)
return self.__class__.RunningCommandCls(cmd, call_args, stdin, stdout, stderr)


def compile_args(a, kwargs, sep, prefix):
Expand Down

0 comments on commit 36c3d19

Please sign in to comment.