fix gbs function test run error issues 51/293451/3
authorbiao716.wang <biao716.wang@samsung.com>
Mon, 29 May 2023 11:22:25 +0000 (20:22 +0900)
committerbiao716.wang <biao716.wang@samsung.com>
Tue, 30 May 2023 05:48:48 +0000 (14:48 +0900)
Change-Id: I3140089d5dc060145144903ad1ef7627aa3f6b6b
Signed-off-by: biao716.wang <biao716.wang@samsung.com>
gitbuildsys/utils.py

index a7c59f2123925b40ac4ba5bb8c4c40b795d040f2..4201425ecb13cc7513823c484388c1772ae90263 100644 (file)
@@ -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)))