From 6d17a23421fd3cd783bf9fa9c90e40f01eb05769 Mon Sep 17 00:00:00 2001 From: Martin Kojtal Date: Tue, 14 Apr 2020 11:27:42 +0100 Subject: [PATCH] importer: fix byte like objects --- tools/importer/importer.py | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/tools/importer/importer.py b/tools/importer/importer.py index 0188654537..46aa91bd54 100644 --- a/tools/importer/importer.py +++ b/tools/importer/importer.py @@ -200,7 +200,7 @@ def branch_exists(name): cmd = ['git', 'branch'] _, output = run_cmd_with_output(cmd, exit_on_failure=False) - return name in output + return name.encode('utf-8') in output def branch_checkout(name): @@ -229,7 +229,7 @@ def get_last_cherry_pick_sha(): shas = re.findall( pattern='^\s*\(cherry picked from commit ([0-9a-fA-F]+)\)$', - string=output, + string=output.decode('utf-8'), flags=re.MULTILINE ) @@ -274,7 +274,7 @@ def get_parser(): def main(): parser = get_parser() args = parser.parse_args() - sha = get_curr_sha(args.repo_path) + sha = get_curr_sha(args.repo_path).decode('utf-8') repo_dir = os.path.basename(args.repo_path) branch = 'feature_' + repo_dir + '_' + sha commit_msg = "[" + repo_dir + "]" + ": Updated to " + sha