FIX: hg backend won't work with PYTHONDEBUG=y

This is due to hg currently having a warning:

$ hg pull
/usr/lib/python3.9/importlib/util.py:245: DeprecationWarning: the imp module is deprecated in favour of importlib; see the module's documentation for alternative uses
  self.__spec__.loader.exec_module(self)

and the has_remote function checking:

   if output.strip() == "":
This commit is contained in:
Julien Palard 2021-03-19 09:51:51 +01:00 committed by mbarkhau
parent 72f1c32348
commit ad9d7f0b52

View file

@ -76,7 +76,7 @@ class VCSAPI:
else: else:
logger.debug(cmd_str) logger.debug(cmd_str)
cmd_parts = shlex.split(cmd_str) cmd_parts = shlex.split(cmd_str)
output_data: bytes = sp.check_output(cmd_parts, env=env, stderr=sp.STDOUT) output_data: bytes = sp.check_output(cmd_parts, env=env, stderr=sp.PIPE)
return output_data.decode("utf-8") return output_data.decode("utf-8")