Skip to content

Commit fdf1d82

Browse files
committed
Use relocatable shebang with space-in-path robustness
1 parent 4a8625d commit fdf1d82

File tree

1 file changed

+2
-1
lines changed

1 file changed

+2
-1
lines changed

cpython-unix/build-cpython.sh

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -858,7 +858,8 @@ def fix_shebang(full):
858858
859859
lines.extend([
860860
b"#!/bin/sh\n",
861-
b'"exec" "\$(dirname \$0)/python${PYTHON_MAJMIN_VERSION}${PYTHON_BINARY_SUFFIX}" "\$0" "\$@"\n',
861+
b"'''exec' \"$(dirname -- \"$(realpath -- \"$0\")\")\"/'python${PYTHON_MAJMIN_VERSION}${PYTHON_BINARY_SUFFIX}' \"$0\" \"$@\"\n",
862+
b"' '''\n",
862863
])
863864
864865
lines.extend(fh)

0 commit comments

Comments
 (0)