Skip to content

Commit ab1d03f

Browse files
authored
Stop using global variable in warn_or_error_if_python_version_file_missing() (#2076)
Longer term I'll refactor `bin/compile` to reduce the number of globals set, to prevent accidentally relying on globals in the library functions.
1 parent 62fb854 commit ab1d03f

2 files changed

Lines changed: 2 additions & 1 deletion

File tree

bin/compile

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -139,7 +139,7 @@ fi
139139
# as to what was a warning vs an error. In addition, several of the error messages contain similar
140140
# content to the warnings (such as encouraging use of .python-version and major version syntax),
141141
# which would mean duplicate content if we showed both.
142-
python_version::warn_or_error_if_python_version_file_missing "${python_version_origin}" "${python_major_version}"
142+
python_version::warn_or_error_if_python_version_file_missing "${python_version_origin}" "${python_major_version}" "${package_manager}"
143143
python_version::warn_if_deprecated_major_version "${python_major_version}" "${python_version_origin}"
144144
python_version::warn_if_patch_update_available "${python_full_version}" "${python_major_version}" "${python_version_origin}"
145145

lib/python_version.sh

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -539,6 +539,7 @@ function python_version::resolve_python_version() {
539539
function python_version::warn_or_error_if_python_version_file_missing() {
540540
local python_version_origin="${1}"
541541
local python_major_version="${2}"
542+
local package_manager="${3}"
542543

543544
if [[ "${python_version_origin}" == ".python-version" ]]; then
544545
return 0

0 commit comments

Comments
 (0)