Commits

Doug Hellmann committed af7e3de

move error reporting for bad python interpreter closer to where the error occurs

Comments (0)

Files changed (1)

virtualenvwrapper.sh

         fi
         # cat "$hook_script"
         source "$hook_script"
+	elif [ "${1}" = "initialize" ]
+	then
+        cat - 1>&2 <<EOF 
+virtualenvwrapper.sh: There was a problem running the initialization hooks. 
+
+If Python could not import the module virtualenvwrapper.hook_loader,
+check that virtualenv has been installed for
+VIRTUALENVWRAPPER_PYTHON=$VIRTUALENVWRAPPER_PYTHON and that PATH is
+set properly.
+EOF
     fi
     \rm -f "$hook_script"
     return $result
     fi
 
     virtualenvwrapper_run_hook "initialize"
-    if [ $? -ne 0 ]
-    then
-        echo "virtualenvwrapper.sh: There was a problem running the initialization hooks. If Python could not import the module virtualenvwrapper.hook_loader, check that virtualenv has been installed for VIRTUALENVWRAPPER_PYTHON=$VIRTUALENVWRAPPER_PYTHON and that PATH is set properly." 1>&2
-        return 1
-    fi
 
     virtualenvwrapper_setup_tab_completion
 
 
 
 #
-# Invoke the initialization hooks
+# Invoke the initialization functions
 #
 virtualenvwrapper_initialize