[Python-checkins] cpython (merge 3.6 -> default): Closes #29308: Merged fix from 3.6.

vinay.sajip python-checkins at python.org
Fri Jan 27 07:44:01 EST 2017


https://hg.python.org/cpython/rev/aef895fef120
changeset:   106322:aef895fef120
parent:      106319:34fb29694c76
parent:      106321:d3890b44159c
user:        Vinay Sajip <vinay_sajip at yahoo.co.uk>
date:        Fri Jan 27 12:43:41 2017 +0000
summary:
  Closes #29308: Merged fix from 3.6.

files:
  Lib/venv/scripts/nt/Activate.ps1 |  16 +++++++++-------
  1 files changed, 9 insertions(+), 7 deletions(-)


diff --git a/Lib/venv/scripts/nt/Activate.ps1 b/Lib/venv/scripts/nt/Activate.ps1
--- a/Lib/venv/scripts/nt/Activate.ps1
+++ b/Lib/venv/scripts/nt/Activate.ps1
@@ -29,13 +29,15 @@
 
 $env:VIRTUAL_ENV="__VENV_DIR__"
 
-# Set the prompt to include the env name
-# Make sure _OLD_VIRTUAL_PROMPT is global
-function global:_OLD_VIRTUAL_PROMPT {""}
-copy-item function:prompt function:_OLD_VIRTUAL_PROMPT
-function global:prompt {
-    Write-Host -NoNewline -ForegroundColor Green '__VENV_PROMPT__'
-    _OLD_VIRTUAL_PROMPT
+if (! $env:VIRTUAL_ENV_DISABLE_PROMPT) {
+    # Set the prompt to include the env name
+    # Make sure _OLD_VIRTUAL_PROMPT is global
+    function global:_OLD_VIRTUAL_PROMPT {""}
+    copy-item function:prompt function:_OLD_VIRTUAL_PROMPT
+    function global:prompt {
+        Write-Host -NoNewline -ForegroundColor Green '__VENV_PROMPT__'
+        _OLD_VIRTUAL_PROMPT
+    }
 }
 
 # Clear PYTHONHOME

-- 
Repository URL: https://hg.python.org/cpython


More information about the Python-checkins mailing list