Skip to content

Commit

Permalink
work around type errors
Browse files Browse the repository at this point in the history
  • Loading branch information
jenshnielsen committed Sep 23, 2023
1 parent 643cf15 commit 62bc106
Showing 1 changed file with 4 additions and 2 deletions.
6 changes: 4 additions & 2 deletions qcodes/instrument/visa.py
Original file line number Diff line number Diff line change
Expand Up @@ -261,9 +261,11 @@ def close(self) -> None:
self, "resource_manager", None
):
session_found = (
self.resource_manager.session in self.resource_manager.visalib.sessions
self.resource_manager.session in self.resource_manager.visalib.sessions # type: ignore[attr-defined]
)
n_sessions = len(self.resource_manager.visalib.sessions)
# type: The pyvisa-sim visalib has a session attribute but the resource manager is not generic in the
# visalib type so we need to use ignore[attr-defined] to avoid errors on session not being defined.
n_sessions = len(self.resource_manager.visalib.sessions) # type: ignore[attr-defined]
# if this instrument is the last one its safe to reset the device
if session_found and n_sessions == 1:
# work around for https://github.com/pyvisa/pyvisa-sim/issues/83
Expand Down

0 comments on commit 62bc106

Please sign in to comment.