Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(367)

Side by Side Diff: bootstrap/virtualenv/virtualenv_embedded/activate.sh

Issue 2043213002: Roll virtualenv 12.0->15.0.2 (Closed) Base URL: https://chromium.googlesource.com/infra/infra.git@master
Patch Set: vendor virtualenv and exclude from gender check Created 4 years, 6 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
OLDNEW
(Empty)
1 # This file must be used with "source bin/activate" *from bash*
2 # you cannot run it directly
3
4 deactivate () {
5 unset -f pydoc >/dev/null 2>&1
6
7 # reset old environment variables
8 # ! [ -z ${VAR+_} ] returns true if VAR is declared at all
9 if ! [ -z "${_OLD_VIRTUAL_PATH+_}" ] ; then
10 PATH="$_OLD_VIRTUAL_PATH"
11 export PATH
12 unset _OLD_VIRTUAL_PATH
13 fi
14 if ! [ -z "${_OLD_VIRTUAL_PYTHONHOME+_}" ] ; then
15 PYTHONHOME="$_OLD_VIRTUAL_PYTHONHOME"
16 export PYTHONHOME
17 unset _OLD_VIRTUAL_PYTHONHOME
18 fi
19
20 # This should detect bash and zsh, which have a hash command that must
21 # be called to get it to forget past commands. Without forgetting
22 # past commands the $PATH changes we made may not be respected
23 if [ -n "${BASH-}" ] || [ -n "${ZSH_VERSION-}" ] ; then
24 hash -r 2>/dev/null
25 fi
26
27 if ! [ -z "${_OLD_VIRTUAL_PS1+_}" ] ; then
28 PS1="$_OLD_VIRTUAL_PS1"
29 export PS1
30 unset _OLD_VIRTUAL_PS1
31 fi
32
33 unset VIRTUAL_ENV
34 if [ ! "${1-}" = "nondestructive" ] ; then
35 # Self destruct!
36 unset -f deactivate
37 fi
38 }
39
40 # unset irrelevant variables
41 deactivate nondestructive
42
43 VIRTUAL_ENV="__VIRTUAL_ENV__"
44 export VIRTUAL_ENV
45
46 _OLD_VIRTUAL_PATH="$PATH"
47 PATH="$VIRTUAL_ENV/__BIN_NAME__:$PATH"
48 export PATH
49
50 # unset PYTHONHOME if set
51 if ! [ -z "${PYTHONHOME+_}" ] ; then
52 _OLD_VIRTUAL_PYTHONHOME="$PYTHONHOME"
53 unset PYTHONHOME
54 fi
55
56 if [ -z "${VIRTUAL_ENV_DISABLE_PROMPT-}" ] ; then
57 _OLD_VIRTUAL_PS1="$PS1"
58 if [ "x__VIRTUAL_PROMPT__" != x ] ; then
59 PS1="__VIRTUAL_PROMPT__$PS1"
60 else
61 PS1="(`basename \"$VIRTUAL_ENV\"`) $PS1"
62 fi
63 export PS1
64 fi
65
66 # Make sure to unalias pydoc if it's already there
67 alias pydoc 2>/dev/null >/dev/null && unalias pydoc
68
69 pydoc () {
70 python -m pydoc "$@"
71 }
72
73 # This should detect bash and zsh, which have a hash command that must
74 # be called to get it to forget past commands. Without forgetting
75 # past commands the $PATH changes we made may not be respected
76 if [ -n "${BASH-}" ] || [ -n "${ZSH_VERSION-}" ] ; then
77 hash -r 2>/dev/null
78 fi
OLDNEW
« no previous file with comments | « bootstrap/virtualenv/virtualenv_embedded/activate.ps1 ('k') | bootstrap/virtualenv/virtualenv_embedded/activate_this.py » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698