Skip to content

pexpect: SpawnBase.delayafterread can be set to None #14727

@igorp-collabora

Description

@igorp-collabora

Currently typeshed sets this attribute as float only, however, setting it to None is a legitimate value to disable pexpect from sleeping after every read.

https://github.com/pexpect/pexpect/blob/fc8f062518b40bd0862aae870cdedf5d9c0c7fc3/pexpect/spawnbase.py#L72

        # Delay in seconds to sleep after each call to read_nonblocking().
        # Set this to None to skip the time.sleep() call completely: that
        # would restore the behavior from pexpect-2.0 (for performance
        # reasons or because you don't want to release Python's global
        # interpreter lock).
        self.delayafterread = 0.0001

The pexpect's code will check for None and will skip sleeping: https://github.com/pexpect/pexpect/blob/fc8f062518b40bd0862aae870cdedf5d9c0c7fc3/pexpect/expect.py#L170

Metadata

Metadata

Assignees

No one assigned

    Labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions