Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fexpect run() supresses non-zero return codes #28

Open
jianga opened this issue Mar 11, 2016 · 1 comment
Open

fexpect run() supresses non-zero return codes #28

jianga opened this issue Mar 11, 2016 · 1 comment

Comments

@jianga
Copy link

jianga commented Mar 11, 2016

I have a script that includes this:

with expecting(prompts):
        run("python -c 'raise Exception()'")
        # other steps

When I run the script, the exception's non-zero exit code is suppressed and keeps going to the other steps.
When I run the script without expecting(prompts), the code exits like this, which is what I'd like:

Fatal error: run() received nonzero return code 1 while executing!

Requested: python -c 'raise Exception()'
Executed: /bin/bash -l -c "python -c 'raise Exception()'"

Aborting.

I'd like the script to exit when errors occur instead of failing silently and continuing.

@JasperVanDenBosch
Copy link
Owner

Sorry @jianga I don't have time to implement this right now. If anyone else feels like it, feel free to open a PR.

In fact I'm not even sure this can be done with pexpect.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants