diff --git a/changelog.d/12916.misc b/changelog.d/12916.misc new file mode 100644 index 0000000000000000000000000000000000000000..347eb096db7fe635b94efd1b90b49614491e2115 --- /dev/null +++ b/changelog.d/12916.misc @@ -0,0 +1 @@ +Check if we are in a virtual environment before overriding the `PYTHONPATH` environment variable in the demo script. diff --git a/demo/start.sh b/demo/start.sh index 96b3a2ceab2f63ed02d7738740841776af4ff620..fdd75816fb2656fb1ed9e6a5e525320147bcedce 100755 --- a/demo/start.sh +++ b/demo/start.sh @@ -6,11 +6,12 @@ CWD=$(pwd) cd "$DIR/.." || exit -PYTHONPATH=$(readlink -f "$(pwd)") -export PYTHONPATH - - -echo "$PYTHONPATH" +# Do not override PYTHONPATH if we are in a virtual env +if [ "$VIRTUAL_ENV" = "" ]; then + PYTHONPATH=$(readlink -f "$(pwd)") + export PYTHONPATH + echo "$PYTHONPATH" +fi # Create servers which listen on HTTP at 808x and HTTPS at 848x. for port in 8080 8081 8082; do