Skip to content

Commit

Permalink
Merge pull request #4979 from jenshnielsen/silence_pyright_warnings
Browse files Browse the repository at this point in the history
Silence pyright warnings
  • Loading branch information
jenshnielsen authored Feb 7, 2023
2 parents c1f85e4 + 697bf64 commit b2d8b30
Show file tree
Hide file tree
Showing 3 changed files with 10 additions and 6 deletions.
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

0 comments on commit b2d8b30

Please sign in to comment.