From 1d12a2fe07bb24af061cd323e4d8e097a2395dc2 Mon Sep 17 00:00:00 2001 From: "biao716.wang" Date: Mon, 29 May 2023 20:22:25 +0900 Subject: [PATCH] fix gbs function test run error issues Change-Id: I3140089d5dc060145144903ad1ef7627aa3f6b6b Signed-off-by: biao716.wang --- gitbuildsys/utils.py | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/gitbuildsys/utils.py b/gitbuildsys/utils.py index a7c59f2..4201425 100644 --- a/gitbuildsys/utils.py +++ b/gitbuildsys/utils.py @@ -78,8 +78,8 @@ def guess_spec(git_path, packaging_dir, given_spec, commit_id='WC.UNTRACKED'): outp = subprocess.Popen(cmd, stdout=subprocess.PIPE) except (subprocess.CalledProcessError, OSError): raise GbsError("failed to run %s in %s" % (' '.join(cmd), git_path)) - output = outp.communicate()[0] - if not output.decode().startswith('tree %s' % git_object): + output = outp.communicate()[0].decode() + if not output.startswith('tree %s' % git_object): # packaging_dir is a symlink packaging_dir = output check = lambda fname, dir_only=False: file_exists_in_rev(git_path, @@ -754,7 +754,7 @@ def show_file_from_rev(git_path, relative_path, commit_id): try: with Workdir(git_path): return subprocess.Popen(args, - stdout=subprocess.PIPE).communicate()[0] + stdout=subprocess.PIPE).communicate()[0].decode() except (subprocess.CalledProcessError, OSError) as err: log.debug('failed to checkout %s from %s:%s' % (relative_path, commit_id, str(err))) -- 2.7.4