Skip to content

Commit 356be2e

Browse files
committed
ansible_mitogen: Remove unneeded internal _run_cmd()
1 parent 1b8b2c8 commit 356be2e

File tree

1 file changed

+3
-9
lines changed

1 file changed

+3
-9
lines changed

ansible_mitogen/mixins.py

Lines changed: 3 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -476,18 +476,12 @@ def _low_level_execute_command(self, cmd, sudoable=True, in_data=None,
476476
# not used, just adding a filler value
477477
possible_pythons = ['python']
478478

479-
def _run_cmd():
480-
return self._connection.exec_command(
481-
cmd=cmd,
482-
in_data=in_data,
483-
sudoable=sudoable,
484-
mitogen_chdir=chdir,
485-
)
486-
487479
for possible_python in possible_pythons:
488480
try:
489481
self._mitogen_interpreter_candidate = possible_python
490-
rc, stdout, stderr = _run_cmd()
482+
rc, stdout, stderr = self._connection.exec_command(
483+
cmd, in_data, sudoable, mitogen_chdir=chdir,
484+
)
491485
# TODO: what exception is thrown?
492486
except:
493487
# we've reached the last python attempted and failed

0 commit comments

Comments
 (0)