]> git.ipfire.org Git - thirdparty/Python/cpython.git/commitdiff
gh-127503: Fix realpath handling in emscripten cli (#127632)
authorHood Chatham <roberthoodchatham@gmail.com>
Mon, 9 Dec 2024 02:03:11 +0000 (03:03 +0100)
committerGitHub <noreply@github.com>
Mon, 9 Dec 2024 02:03:11 +0000 (10:03 +0800)
Corrects the handling of realpath on Linux.

Tools/wasm/emscripten/__main__.py

index c998ed71309dad10eece3ce62ea9f0336feb09b8..6843b6fdeceb8c9f9c031fcb847e3636d79491b8 100644 (file)
@@ -223,7 +223,7 @@ def configure_emscripten_python(context, working_dir):
             if which grealpath > /dev/null; then
                 # It has brew installed gnu core utils, use that
                 REALPATH="grealpath -s"
-            elif which realpath > /dev/null && realpath --version 2&>1 | grep GNU > /dev/null; then
+            elif which realpath > /dev/null && realpath --version > /dev/null 2> /dev/null && realpath --version | grep GNU > /dev/null; then
                 # realpath points to GNU realpath so use it.
                 REALPATH="realpath -s"
             else