Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Description
This PR changes the
getenv
function so it does not use pexpect.It is possible to replace all functionality so it doesn't use pexpect, but I'm not sure we want to. The reason is that in most cases the calling code can just replace the calls to ska_shell with a line calling subprocess, and that is less work than making ska_shell pexpect-free. In case where we care about a specific behavior, I don't see the point of forcing the current ska_shell interface and behavior. For example:
logfile
argument, but in this day and age we would prefer alogging.Logger
or just a function.importenv
argument torun_shell
, but it can do that because it can make one last call to the shell instance to get the environment. In subprocess, it would require a bit of work.If one does not care about keeping the exact arguments and behavior, then it is trivial to replace pexpect with subprocess.
Interface impacts
Testing
Unit tests
Independent check of unit tests by [REVIEWER NAME]
Functional tests
No functional testing.