Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Silence pyright warnings #4979

Merged
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion qcodes/instrument_drivers/Minicircuits/USBHIDMixin.py
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@
from typing import Any, List, Optional

try:
import pywinusb.hid as hid
import pywinusb.hid as hid # pyright: ignore[reportMissingModuleSource]

imported_hid = True
except ImportError:
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -6,9 +6,13 @@
log = logging.getLogger(__name__)

try:
import pythoncom
import win32com.client
from pythoncom import VT_BYREF, VT_I4, VT_R8
import pythoncom # pyright: ignore[reportMissingModuleSource]
import win32com.client # pyright: ignore[reportMissingModuleSource]
from pythoncom import ( # pyright: ignore[reportMissingModuleSource]
VT_BYREF,
VT_I4,
VT_R8,
)
except ImportError as e:
message = "To use the DynaCool Driver, please install pywin32."
log.exception(message)
Expand Down
4 changes: 2 additions & 2 deletions qcodes/utils/qt_helpers.py
Original file line number Diff line number Diff line change
Expand Up @@ -19,8 +19,8 @@ def foreground_qt_window(window: "QMainWindow") -> None:
>>> Qtplot.qt_helpers.foreground_qt_window(plot.win)
"""
try:
import win32con
from win32gui import SetWindowPos
import win32con # pyright: ignore[reportMissingModuleSource]
from win32gui import SetWindowPos # pyright: ignore[reportMissingModuleSource]

# use the idea from
# https://stackoverflow.com/questions/12118939/how-to-make-a-pyqt4-window-jump-to-the-front
Expand Down