Platform-Specific Imports - Ignore 'Unresolved Import' for specific package
jaymegordo opened this issue · 3 comments
jaymegordo commented
erictraut commented
One option is to replace the f.is_mac()
and f.is_win()
calls with sys.platform == 'darwin'
and sys.platform == 'win32'
respectively. Pylance will recognize these built-in conditional checks and analyze only the portions of the code that apply to your current platform.
jakebailey commented
If you add # noqa
to the line, does the message disappear?
jaymegordo commented
@erictraut @jakebailey Both solutions work, very helpful thanks!