From 53c00dc0745dbbccc94726fe3373325212e24ce1 Mon Sep 17 00:00:00 2001 From: Jakub Kadlčík Date: May 29 2017 21:26:42 +0000 Subject: Allow stdout and stderr to be something else than file --- diff --git a/module_build_service/builder/utils.py b/module_build_service/builder/utils.py index 31633f1..6b2e163 100644 --- a/module_build_service/builder/utils.py +++ b/module_build_service/builder/utils.py @@ -90,9 +90,9 @@ def execute_cmd(args, stdout=None, stderr=None, cwd=None): :raises RuntimeError: Raised when command exits with non-zero exit code. """ out_log_msg = "" - if stdout: + if stdout and hasattr(stdout, "name"): out_log_msg += ", stdout log: %s" % stdout.name - if stderr: + if stderr and hasattr(stderr, "name"): out_log_msg += ", stderr log: %s" % stderr.name log.info("Executing command: %s%s" % (args, out_log_msg))