Skip to content

Commit

Permalink
also reset if there are no sessions
Browse files Browse the repository at this point in the history
  • Loading branch information
jenshnielsen committed Sep 23, 2023
1 parent 4a903d1 commit adcd46c
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions qcodes/instrument/visa.py
Original file line number Diff line number Diff line change
Expand Up @@ -266,8 +266,8 @@ def close(self) -> None:
# 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:
# if this instrument is the last one or there are no connected instruments its safe to reset the device
if (session_found and n_sessions == 1) or n_sessions == 0:
# work around for https://github.com/pyvisa/pyvisa-sim/issues/83
# see other issues for more context
# https://github.com/QCoDeS/Qcodes/issues/5356 and
Expand Down

0 comments on commit adcd46c

Please sign in to comment.