Add ignore comment for error Pylance gives even though pyright doesn't

With Pyright's strict mode disabled, I got zero issues from the CLI,
but got a Problem underline in VS Code from Pylance:
- "Gio" is unknown import symbol Pylance(reportGeneralTypeIssues)

This also silences, on the same line:
- Type of "Gio" is unknown Pylance(reportUnknownVariableType)

gi.repository uses DynamicImporter, which I assume is all the reason
the type checker "needs" to be confused, so I'm not worried about this.
This commit is contained in:
Isaiah Odhner 2023-05-01 17:07:26 -04:00
parent d8d0871729
commit 4ff90fa8ec

View File

@ -92,7 +92,7 @@ def set_wallpaper(file_loc: str, first_run: bool = True):
if desktop_env in ["gnome", "unity", "cinnamon"]:
uri = "'file://%s'" % file_loc
try:
from gi.repository import Gio
from gi.repository import Gio # type: ignore
SCHEMA = "org.gnome.desktop.background"
KEY = "picture-uri"
gsettings = Gio.Settings.new(SCHEMA)