Skip to content

Commit e83a1f1

Browse files
committed
Generate pydoc executable after creating new virtualenv (fixes #197, pyenv/pyenv#963)
1 parent 2727087 commit e83a1f1

File tree

1 file changed

+10
-0
lines changed

1 file changed

+10
-0
lines changed

bin/pyenv-virtualenv

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -533,6 +533,16 @@ if [ -d "${VIRTUALENV_PATH}" ] && [ -n "${COMPAT_VIRTUALENV_PATH}" ]; then
533533
ln -fs "${VIRTUALENV_PATH}" "${COMPAT_VIRTUALENV_PATH}"
534534
fi
535535

536+
if [ ! -e "${VIRTUALENV_PATH}/bin/pydoc" ]; then
537+
cat <<EOS > "${VIRTUALENV_PATH}/bin/pydoc"
538+
#!${VIRTUALENV_PATH}/bin/python
539+
import pydoc
540+
if __name__ == '__main__':
541+
pydoc.cli()
542+
EOS
543+
chmod +x "${VIRTUALENV_PATH}/bin/pydoc"
544+
fi
545+
536546
if [ -z "${NO_ENSUREPIP}" ]; then
537547
## Install setuptools and pip.
538548
PYENV_VERSION="${VIRTUALENV_NAME}" build_package_ensurepip

0 commit comments

Comments
 (0)