Skip to content

os.EX_OK exists on Win32 #10242

Closed
Closed
@michaelmhoffman

Description

@michaelmhoffman

Running python.exe -m mypy . on a directory where there's a script with from os import EX_OK leads to an error on Windows:

pdfcomments\__main__.py:20: error: Module "os" has no attribute "EX_OK"; maybe "X_OK"?  [attr-defined]

stdlib/os/__init__.pyi contains a type hint for EX_OK that is guarded by an if sys.platform != "win32" block. However, since python/cpython@19459f8, EX_OK has been supported on Windows. It should be placed outside the guard block.

Metadata

Metadata

Assignees

No one assigned

    Labels

    help wantedAn actionable problem of low to medium complexity where a PR would be very welcomestubs: incompleteAnnotations or sub-modules missing from an existing package or module

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions