-
-
Notifications
You must be signed in to change notification settings - Fork 8.6k
Closed
Closed
Copy link
Labels
C-pyPython BindingsPython BindingsI-defectSomething is not working as intendedSomething is not working as intended
Description
Description
The Python bindings use platform.system() for detecting Windows to run platform-specific code in many places. This works fine, but we run into issues with our type checker (mypy). It doesn't respect platform.system(), so we get type errors in some of our platform-specific code when the type checker runs on other platforms. see: comments on #16250
mypy does do the right thing if you use sys.platform for platform detection instead:
https://mypy.readthedocs.io/en/stable/common_issues.html#python-version-and-system-platform-checks
We should investigate where we are using platform.system() and switch to sys.platform if possible.
Reproducible Code
if platform.system() == "Windows"Metadata
Metadata
Assignees
Labels
C-pyPython BindingsPython BindingsI-defectSomething is not working as intendedSomething is not working as intended