setup: treat error output and non-zero return code differently stable
authorPierre-Yves David <pierre-yves.david@octobus.net>
Mon, 30 Jan 2023 18:50:11 +0100
branchstable
changeset 49971 ac93876ea2df
parent 49970 8d390a13474d
child 49972 1bd33932713d
child 49973 68cf519429ef
setup: treat error output and non-zero return code differently Choking on Mercurial's stderr mean armless warning can derails the whole install process. We do like to be able to issue warning to people so we stop considering any stderr is a fatal mistake. This allow us to actually boostrap a version of Mercurial without loosing to many sanity point. For example in case where evolve is not loaded, something that happens when the recorded version is malformatted. Creating a wonderful ouroboros.
setup.py
--- a/setup.py	Mon Jan 30 18:41:59 2023 +0100
+++ b/setup.py	Mon Jan 30 18:50:11 2023 +0100
@@ -221,9 +221,10 @@
         cmd = self.cmd + args
         returncode, out, err = runcmd(cmd, self.env)
         err = filterhgerr(err)
-        if err or returncode != 0:
+        if err:
             print("stderr from '%s':" % (' '.join(cmd)), file=sys.stderr)
             print(err, file=sys.stderr)
+        if returncode != 0:
             return b''
         return out