Fix small bugs (python37) (#577)

* Fix small bugs (python37)

* Update utils.py

* Update utils.py

* Update utils.py

* Update utils.py

* Update utils.py
This commit is contained in:
Pascal Vizeli 2018-07-19 21:22:26 +02:00 committed by GitHub
parent 3aa4cdf540
commit 1b481e0b37
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -39,15 +39,15 @@ def check_installed(method):
async def remove_data(folder): async def remove_data(folder):
"""Remove folder and reset privileged.""" """Remove folder and reset privileged."""
try: try:
proc = await asyncio.create_subprocess_shell( proc = await asyncio.create_subprocess_exec(
["rm", "-rf", str(folder)], stdout=asyncio.DEVNULL "rm", "-rf", str(folder),
stdout=asyncio.subprocess.DEVNULL
) )
response = await proc.communicate() _, error_msg = await proc.communicate()
wrong = response[1].decode()
except OSError as err: except OSError as err:
wrong = str(err) error_msg = str(err)
if proc.returncode == 0: if proc.returncode == 0:
return return
_LOGGER.error("Can't remove Add-on Data: %s", wrong) _LOGGER.error("Can't remove Add-on Data: %s", error_msg)