Skip to content

monkey_patch(subprocess=True) doesn't patch CalledProcessError #357

@nat-goodspeed

Description

@nat-goodspeed

My script uses:

eventlet.monkey_patch(os=True, select=True, socket=True, time=True,
                  builtins=True, subprocess=True)
# ...
import subprocess
# ...
try:
    output = subprocess.check_output(...)
except subprocess.CalledProcessError as error:
    # ...

This fails to catch CalledProcessError. Changing the except line to:

except eventlet.green.subprocess.CalledProcessError as error:

does catch the exception.

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions