From ad3d3b2d19c412e648ab77dfc4c80b3a0f160656 Mon Sep 17 00:00:00 2001 From: "Jose M. Guisado" Date: Wed, 27 Apr 2022 09:38:38 +0200 Subject: utils: decode probing subprocess stdout Cannot replace str ('\n') when stdout is a bytes object. Also fixes some typos (i.e: proc_releaseid stdout was used twice). --- src/utils/probe.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'src') diff --git a/src/utils/probe.py b/src/utils/probe.py index 4600ff4..d14146c 100644 --- a/src/utils/probe.py +++ b/src/utils/probe.py @@ -52,8 +52,8 @@ def getwindowsversion(winreghives): 'microsoft\windows nt\currentversion', 'ReleaseId'], stdout=PIPE) - proc_prodname = proc_releaseid.stdout.replace('\n', '') - releaseid = proc_releaseid.stdout.replace('\n', '') + prodname = proc_prodname.stdout.decode().replace('\n', '') + releaseid = proc_releaseid.stdout.decode().replace('\n', '') if proc_prodname.returncode == 0 and proc_releaseid.returncode == 0: return f'{prodname} {releaseid}' -- cgit v1.2.3-18-g5258