Skip to content

Commit

Permalink
Merge pull request #613 from amoffat/604-allow-custom-runningcommand-cls
Browse files Browse the repository at this point in the history
Allow customizing the RunningCommand class
  • Loading branch information
ecederstrand committed Aug 4, 2022
2 parents 5aa5051 + 87cd91b commit 927a1f7
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion sh.py
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 927a1f7

Please sign in to comment.