Skip to content

Official Codebase of 3DCodeVerse

Python

bin/3dcode: python -P so a codeverse3d in the caller's cwd never shadows the plugin

gaoypeng33499629f439
diff --git a/harness/bin/3dcode b/harness/bin/3dcode
index ca863d6c..24c487b3 100755
--- a/harness/bin/3dcode
+++ b/harness/bin/3dcode
@@ -1,9 +1,9 @@
#!/usr/bin/env bash
-# 3dcode launcher: $C3D_PYTHON, else <plugin>/.venv/bin/python, else python3; the plugin root on PYTHONPATH.
+# 3dcode launcher (-P: the caller's cwd never shadows the package): $C3D_PYTHON, else <plugin>/.venv/bin/python, else python3; the plugin root on PYTHONPATH.
set -euo pipefail
HERE="$(cd "$(dirname "${BASH_SOURCE[0]}")/.." && pwd)"
PY="${C3D_PYTHON:-}"
if [ -z "$PY" ] && [ -x "$HERE/.venv/bin/python" ]; then PY="$HERE/.venv/bin/python"; fi
if [ -z "$PY" ]; then PY="python3"; fi
export PYTHONPATH="$HERE${PYTHONPATH:+:$PYTHONPATH}"
-exec "$PY" -m codeverse3d.cli "$@"
+exec "$PY" -P -m codeverse3d.cli "$@"