Skip to content

Commit 764a925

Browse files
committed
Import distutils.sysconfig properly (fixes #167)
Signed-off-by: Christopher Arndt <[email protected]>
1 parent cee707f commit 764a925

File tree

1 file changed

+9
-9
lines changed

1 file changed

+9
-9
lines changed

virtualenvwrapper.sh

Lines changed: 9 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -244,8 +244,8 @@ function virtualenvwrapper_run_hook {
244244
source "$hook_script"
245245
elif [ "${1}" = "initialize" ]
246246
then
247-
cat - 1>&2 <<EOF
248-
virtualenvwrapper.sh: There was a problem running the initialization hooks.
247+
cat - 1>&2 <<EOF
248+
virtualenvwrapper.sh: There was a problem running the initialization hooks.
249249
250250
If Python could not import the module virtualenvwrapper.hook_loader,
251251
check that virtualenvwrapper has been installed for
@@ -557,7 +557,7 @@ function rmvirtualenv {
557557
# List the available environments.
558558
function virtualenvwrapper_show_workon_options {
559559
virtualenvwrapper_verify_workon_home || return 1
560-
# NOTE: DO NOT use ls or cd here because colorized versions spew control
560+
# NOTE: DO NOT use ls or cd here because colorized versions spew control
561561
# characters into the output list.
562562
# echo seems a little faster than find, even with -depth 3.
563563
# Note that this is a little tricky, as there may be spaces in the path.
@@ -572,7 +572,7 @@ function virtualenvwrapper_show_workon_options {
572572
# a slash, as that is an illegal character in a directory name.
573573
# This yields a slash-separated list of possible env names.
574574
# 4. Replace each slash with a newline to show the output one name per line.
575-
# 5. Eliminate any lines with * on them because that means there
575+
# 5. Eliminate any lines with * on them because that means there
576576
# were no envs.
577577
(virtualenvwrapper_cd "$WORKON_HOME" && echo */$VIRTUALENVWRAPPER_ENV_BIN_DIR/activate) 2>/dev/null \
578578
| command \tr "\n" " " \
@@ -809,7 +809,7 @@ function virtualenvwrapper_get_python_version {
809809

810810
# Prints the path to the site-packages directory for the current environment.
811811
function virtualenvwrapper_get_site_packages_dir {
812-
"$VIRTUAL_ENV/$VIRTUALENVWRAPPER_ENV_BIN_DIR/python" -c "import distutils; print(distutils.sysconfig.get_python_lib())"
812+
"$VIRTUAL_ENV/$VIRTUALENVWRAPPER_ENV_BIN_DIR/python" -c "import distutils.sysconfig; print(distutils.sysconfig.get_python_lib())"
813813
}
814814

815815
# Path management for packages outside of the virtual env.
@@ -947,7 +947,7 @@ function cpvirtualenv {
947947
typeset src_name="$1"
948948
typeset trg_name="$2"
949949
typeset src
950-
typeset trg
950+
typeset trg
951951

952952
# without a source there is nothing to do
953953
if [ "$src_name" = "" ]; then
@@ -991,10 +991,10 @@ function cpvirtualenv {
991991

992992
echo "Copying $src_name as $trg_name..."
993993
(
994-
[ -n "$ZSH_VERSION" ] && setopt SH_WORD_SPLIT
994+
[ -n "$ZSH_VERSION" ] && setopt SH_WORD_SPLIT
995995
virtualenvwrapper_cd "$WORKON_HOME" &&
996-
"$VIRTUALENVWRAPPER_VIRTUALENV_CLONE" "$src" "$trg"
997-
[ -d "$trg" ] &&
996+
"$VIRTUALENVWRAPPER_VIRTUALENV_CLONE" "$src" "$trg"
997+
[ -d "$trg" ] &&
998998
virtualenvwrapper_run_hook "pre_cpvirtualenv" "$src" "$trg_name" &&
999999
virtualenvwrapper_run_hook "pre_mkvirtualenv" "$trg_name"
10001000
)

0 commit comments

Comments
 (0)