Bug Report
It seems that conditions using platform.system() are not treated the same way as those using sys.platform. I'm not sure if this is a bug or a missing feature.
To Reproduce
import platform
import sys
def works() -> None:
if sys.platform == "win32":
import some_win_dependency
some_win_dependency.do_stuff()
return
...
return
def doesnt_work() -> None:
if platform.system() == "Windows":
import some_win_dependency # got [import-not-found]
some_win_dependency.do_stuff()
return
...
return
Your Environment
- Mypy version used: 1.15.0
- Mypy command-line flags:
- Mypy configuration options from
mypy.ini (and other config files):
- Python version used: 3.13