From: biao716.wang Date: Fri, 2 Dec 2022 09:04:30 +0000 (+0900) Subject: fix Popen return error: python3.x return bytes, not str X-Git-Tag: accepted/tools/devbase/tools/20250527.103741~18^2~6 X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=0a8c6409a2dd18fc5232e140c75ef5f25d7934a2;p=tools%2Fgbs.git fix Popen return error: python3.x return bytes, not str Change-Id: I8a4c0c566daf98aca4090d6a40b66e71cad4d7d4 Signed-off-by: biao716.wang --- diff --git a/gitbuildsys/utils.py b/gitbuildsys/utils.py index 1039c22..39082c6 100644 --- a/gitbuildsys/utils.py +++ b/gitbuildsys/utils.py @@ -79,7 +79,7 @@ def guess_spec(git_path, packaging_dir, given_spec, commit_id='WC.UNTRACKED'): except (subprocess.CalledProcessError, OSError): raise GbsError("failed to run %s in %s" % (' '.join(cmd), git_path)) output = outp.communicate()[0] - if not output.startswith('tree %s' % git_object): + if not output.decode().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, @@ -777,7 +777,7 @@ def file_exists_in_rev(git_path, relative_path, commit_id, dir_only=False): raise GbsError('failed to check existence of %s in %s:%s' % ( relative_path, commit_id, str(err))) - return output != '' + return output.decode() != '' def glob_in_inc(git_path, packaging_dir, pattern): @@ -804,7 +804,7 @@ def glob_in_rev(git_path, pattern, commit_id): raise GbsError('failed to glob %s in %s:%s' % ( pattern, commit_id, str(err))) - return fnmatch.filter(output.splitlines(), pattern) + return fnmatch.filter(output.decode().splitlines(), pattern) def get_editor_cmd():