From 002afb47e9423d0ffadfe725a03062d9863e95ed Mon Sep 17 00:00:00 2001 From: FuPeiJiang <42662615+FuPeiJiang@users.noreply.github.com> Date: Fri, 19 Aug 2022 10:23:20 -0400 Subject: [PATCH] input.py: use `text=True` to not `.decode("utf-8")` --- gyp/pylib/gyp/input.py | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/gyp/pylib/gyp/input.py b/gyp/pylib/gyp/input.py index d9699a0a50..f76e75797e 100644 --- a/gyp/pylib/gyp/input.py +++ b/gyp/pylib/gyp/input.py @@ -967,7 +967,8 @@ def ExpandVariables(input, phase, variables, build_file): stdout=subprocess.PIPE, shell=use_shell, cwd=build_file_dir, - check=False + check=False, + text=True ) except Exception as e: raise GypError( @@ -980,7 +981,7 @@ def ExpandVariables(input, phase, variables, build_file): "Call to '%s' returned exit status %d while in %s." % (contents, result.returncode, build_file) ) - replacement = result.stdout.decode("utf-8").rstrip() + replacement = result.stdout.rstrip() cached_command_results[cache_key] = replacement else: