From 0c7b7994e230f5f8531740f700aeb32a0add5096 Mon Sep 17 00:00:00 2001 From: Jean-Yves LENHOF Date: Wed, 19 Nov 2025 15:10:04 +0100 Subject: [PATCH] add fix --- dist/post-python/index.js | 2 +- dist/setup/index.js | 2 +- src/clean-pip.ts | 2 +- 3 files changed, 3 insertions(+), 3 deletions(-) diff --git a/dist/post-python/index.js b/dist/post-python/index.js index be9041af..e215dcd4 100644 --- a/dist/post-python/index.js +++ b/dist/post-python/index.js @@ -87855,7 +87855,7 @@ async function cleanPipPackages() { // Use a shell so we can pipe the output of pip freeze into xargs await (0, exec_1.exec)('bash', [ '-c', - 'test $(python -m pip freeze | wc -l) -gt 0 && python -m pip freeze | xargs python -m pip uninstall -y || true' + 'test $(which python) != "/usr/bin/python" -a $(python -m pip freeze | wc -l) -gt 0 && python -m pip freeze | xargs python -m pip uninstall -y || true' ]); core.info('Successfully cleaned up pip packages'); } diff --git a/dist/setup/index.js b/dist/setup/index.js index ea3518bb..77b8ef34 100644 --- a/dist/setup/index.js +++ b/dist/setup/index.js @@ -96746,7 +96746,7 @@ async function cleanPipPackages() { // Use a shell so we can pipe the output of pip freeze into xargs await (0, exec_1.exec)('bash', [ '-c', - 'test $(python -m pip freeze | wc -l) -gt 0 && python -m pip freeze | xargs python -m pip uninstall -y || true' + 'test $(which python) != "/usr/bin/python" -a $(python -m pip freeze | wc -l) -gt 0 && python -m pip freeze | xargs python -m pip uninstall -y || true' ]); core.info('Successfully cleaned up pip packages'); } diff --git a/src/clean-pip.ts b/src/clean-pip.ts index dcc1010c..3c926680 100644 --- a/src/clean-pip.ts +++ b/src/clean-pip.ts @@ -9,7 +9,7 @@ export async function cleanPipPackages() { // Use a shell so we can pipe the output of pip freeze into xargs await exec('bash', [ '-c', - 'test $(python -m pip freeze | wc -l) -gt 0 && python -m pip freeze | xargs python -m pip uninstall -y || true' + 'test $(which python) != "/usr/bin/python" -a $(python -m pip freeze | wc -l) -gt 0 && python -m pip freeze | xargs python -m pip uninstall -y || true' ]); core.info('Successfully cleaned up pip packages'); } catch (error) {