Skip to content

Commit 51c7b78

Browse files
committed
ansible_mitogen: Decouple possible_pythons order & error handling
'python' could now be tried earlier, or not at all.
1 parent 356be2e commit 51c7b78

File tree

2 files changed

+3
-2
lines changed

2 files changed

+3
-2
lines changed

ansible_mitogen/mixins.py

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -485,8 +485,7 @@ def _low_level_execute_command(self, cmd, sudoable=True, in_data=None,
485485
# TODO: what exception is thrown?
486486
except:
487487
# we've reached the last python attempted and failed
488-
# TODO: could use enumerate(), need to check which version of python first had it though
489-
if possible_python == 'python':
488+
if possible_python == possible_pythons[-1]:
490489
raise
491490
else:
492491
continue

docs/changelog.rst

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -30,6 +30,8 @@ In progress (unreleased)
3030
discovery attributes
3131
* :gh:issue:`1213` :mod:`ansible_mitogen`: Rename Mitogen interpreter discovery
3232
attributes
33+
* :gh:issue:`1213` :mod:`ansible_mitogen`: Decouple possible_pythons order &
34+
error handling
3335

3436

3537
v0.3.21 (2025-01-20)

0 commit comments

Comments
 (0)