Skip to content

Commit 99b8ba6

Browse files
authored
Remove redundant internal error handling for venv creation (#1937)
Since: - The underlying cause of the errors (a bug in older `ensurepip`) was fixed in #1761 and friends. - As of #1933 the generic error trap now handles all internal errors, meaning we don't custom handling for them any more. GUS-W-19898848.
1 parent 2fe232c commit 99b8ba6

3 files changed

Lines changed: 3 additions & 26 deletions

File tree

CHANGELOG.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,7 @@
22

33
## [Unreleased]
44

5+
- Removed redundant internal error handling for venv creation. ([#1937](https://github.com/heroku/heroku-buildpack-python/pull/1937))
56

67
## [v314] - 2025-10-15
78

lib/pipenv.sh

Lines changed: 1 addition & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -40,19 +40,7 @@ function pipenv::install_pipenv() {
4040

4141
# We use the pip wheel bundled within Python's standard library to install Pipenv,
4242
# since Pipenv vendors its own pip, so doesn't need an install in the venv.
43-
# shellcheck disable=SC2310 # This function is invoked in an 'if' condition so set -e will be disabled.
44-
if ! python -m venv --without-pip "${pipenv_venv_dir}" |& output::indent; then
45-
output::error <<-EOF
46-
Internal Error: Unable to create virtual environment for Pipenv.
47-
48-
The 'python -m venv' command to create a virtual environment did
49-
not exit successfully.
50-
51-
See the log output above for more information.
52-
EOF
53-
build_data::set_string "failure_reason" "internal-error::create-venv::pipenv"
54-
exit 1
55-
fi
43+
python -m venv --without-pip "${pipenv_venv_dir}"
5644

5745
local bundled_pip_module_path
5846
bundled_pip_module_path="$(utils::bundled_pip_module_path "${python_home}" "${python_major_version}")"

lib/poetry.sh

Lines changed: 1 addition & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -46,19 +46,7 @@ function poetry::install_poetry() {
4646
# it bundles its own copy for use as a fallback. As such we don't need to install pip
4747
# into the Poetry venv (and in fact, Poetry wouldn't use this install anyway, since
4848
# it only finds an external pip if it exists in the target venv).
49-
# shellcheck disable=SC2310 # This function is invoked in an 'if' condition so set -e will be disabled.
50-
if ! python -m venv --without-pip "${poetry_venv_dir}" |& output::indent; then
51-
output::error <<-EOF
52-
Internal Error: Unable to create virtual environment for Poetry.
53-
54-
The 'python -m venv' command to create a virtual environment did
55-
not exit successfully.
56-
57-
See the log output above for more information.
58-
EOF
59-
build_data::set_string "failure_reason" "internal-error::create-venv::poetry"
60-
exit 1
61-
fi
49+
python -m venv --without-pip "${poetry_venv_dir}"
6250

6351
local bundled_pip_module_path
6452
bundled_pip_module_path="$(utils::bundled_pip_module_path "${python_home}" "${python_major_version}")"

0 commit comments

Comments
 (0)