[3.12] gh-112252: Fix error on unset $OSNAME in venv/activate (GH-112253) (GH-112297)

(cherry picked from commit e1540ae74d)

Co-authored-by: James Turk <dev@jamesturk.net>
This commit is contained in:
Miss Islington (bot) 2023-12-25 20:07:09 +01:00 committed by GitHub
parent fc7e67f51a
commit 2c07540e7d
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

View file

@ -36,7 +36,7 @@ deactivate () {
deactivate nondestructive deactivate nondestructive
# on Windows, a path can contain colons and backslashes and has to be converted: # on Windows, a path can contain colons and backslashes and has to be converted:
if [ "$OSTYPE" = "cygwin" ] || [ "$OSTYPE" = "msys" ] ; then if [ "${OSTYPE:-}" = "cygwin" ] || [ "${OSTYPE:-}" = "msys" ] ; then
# transform D:\path\to\venv to /d/path/to/venv on MSYS # transform D:\path\to\venv to /d/path/to/venv on MSYS
# and to /cygdrive/d/path/to/venv on Cygwin # and to /cygdrive/d/path/to/venv on Cygwin
export VIRTUAL_ENV=$(cygpath "__VENV_DIR__") export VIRTUAL_ENV=$(cygpath "__VENV_DIR__")