Skip to content

stderr is not always captured by mypy.api.run #7800

@dmtucker

Description

@dmtucker

Sometimes, stderr is printed instead of being returned from mypy.api.run.

Here is an SSCCE:

import mypy.api
print(mypy.api.run(['--foo']))

mypy 0.701:

('', 'usage: mypy [-h] [-v] [-V] [more options; see below]\n            [-m MODULE] [-p PACKAGE] [-c PROGRAM_TEXT] [files ...]\nmypy: error: unrecognized arguments: --foo\n', 2)

mypy 0.710:

usage: mypy [-h] [-v] [-V] [more options; see below]
            [-m MODULE] [-p PACKAGE] [-c PROGRAM_TEXT] [files ...]
mypy: error: unrecognized arguments: --foo
('', '', 2)

Metadata

Metadata

Assignees

No one assigned

    Labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions