Prevent decoding None objects

This commit is contained in:
Davte 2020-07-15 13:15:48 +02:00
parent ed05d843bc
commit ada375b766
Signed by: Davte
GPG Key ID: D848081D6F892DA9
2 changed files with 5 additions and 3 deletions

View File

@ -11,7 +11,7 @@ __author__ = "Davide Testa"
__email__ = "davide@davte.it" __email__ = "davide@davte.it"
__credits__ = ["Marco Origlia", "Nick Lee @Nickoala"] __credits__ = ["Marco Origlia", "Nick Lee @Nickoala"]
__license__ = "GNU General Public License v3.0" __license__ = "GNU General Public License v3.0"
__version__ = "2.6.6" __version__ = "2.6.7"
__maintainer__ = "Davide Testa" __maintainer__ = "Davide Testa"
__contact__ = "t.me/davte" __contact__ = "t.me/davte"

View File

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