mirror of
https://github.com/ynput/ayon-core.git
synced 2025-12-24 21:04:40 +01:00
Merge pull request #645 from pypeclub/bugfix/lib_subprocess_without_logger
Lib subprocess without logger
This commit is contained in:
commit
2013a2e912
1 changed files with 5 additions and 6 deletions
11
pype/lib.py
11
pype/lib.py
|
|
@ -81,16 +81,16 @@ def get_ffmpeg_tool_path(tool="ffmpeg"):
|
|||
|
||||
|
||||
# Special naming case for subprocess since its a built-in method.
|
||||
def _subprocess(*args, logger=None, **kwargs):
|
||||
def _subprocess(*args, **kwargs):
|
||||
"""Convenience method for getting output errors for subprocess.
|
||||
|
||||
Entered arguments and keyword arguments are passed to subprocess Popen.
|
||||
|
||||
Args:
|
||||
logger (logging.Logger): Logger object if want to use different than
|
||||
lib's logger.
|
||||
*args: Variable length arument list passed to Popen.
|
||||
**kwargs : Arbitary keyword arguments passed to Popen.
|
||||
**kwargs : Arbitary keyword arguments passed to Popen. Is possible to
|
||||
pass `logging.Logger` object under "logger" if want to use
|
||||
different than lib's logger.
|
||||
|
||||
Returns:
|
||||
str: Full output of subprocess concatenated stdout and stderr.
|
||||
|
|
@ -107,8 +107,7 @@ def _subprocess(*args, logger=None, **kwargs):
|
|||
filtered_env = {k: str(v) for k, v in env.items()}
|
||||
|
||||
# Use lib's logger if was not passed with kwargs.
|
||||
if not logger:
|
||||
logger = log
|
||||
logger = kwargs.pop("logger", log)
|
||||
|
||||
# set overrides
|
||||
kwargs['stdout'] = kwargs.get('stdout', subprocess.PIPE)
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue