Prevent decoding None objects

This commit is contained in:
Davte
2020-07-15 13:15:48 +02:00
parent fb58c0239d
commit f7ee5b71a1
2 changed files with 5 additions and 3 deletions

View File

@@ -1714,8 +1714,10 @@ async def aio_subprocess_shell(command: str) -> Tuple[str, str]:
command
)
stdout, stderr = await _subprocess.communicate()
stdout = stdout.decode().strip()
stderr = stderr.decode().strip()
if stdout:
stdout = stdout.decode().strip()
if stderr:
stderr = stderr.decode().strip()
except Exception as e:
logging.error(
"Exception {e}:\n{o}\n{er}".format(