]> git.ipfire.org Git - thirdparty/Python/cpython.git/commitdiff
[3.12] gh-112252: Fix error on unset $OSNAME in venv/activate (GH-112253) (GH-112297)
authorMiss Islington (bot) <31488909+miss-islington@users.noreply.github.com>
Mon, 25 Dec 2023 19:07:09 +0000 (20:07 +0100)
committerGitHub <noreply@github.com>
Mon, 25 Dec 2023 19:07:09 +0000 (21:07 +0200)
(cherry picked from commit e1540ae74d1fce62f53e25838ba21746ba5d8444)

Co-authored-by: James Turk <dev@jamesturk.net>
Lib/venv/scripts/common/activate

index 91650661db083bc8060178160538d40a756d1730..d5914e0cbb40d581cc7e6df983465c5f2a8af3a8 100644 (file)
@@ -36,7 +36,7 @@ deactivate () {
 deactivate nondestructive
 
 # 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
     # and to /cygdrive/d/path/to/venv on Cygwin
     export VIRTUAL_ENV=$(cygpath "__VENV_DIR__")