Skip to content

Commit

Permalink
Merge pull request #157 from Galvant/fix-visa_version_check
Browse files Browse the repository at this point in the history
Fix pyVISA version checking
  • Loading branch information
scasagrande authored Dec 13, 2016
2 parents d272b3d + 5887d72 commit 0f226a5
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion instruments/abstract_instruments/comm/visa_communicator.py
Original file line number Diff line number Diff line change
Expand Up @@ -45,7 +45,8 @@ def __init__(self, conn):
if visa is None:
raise ImportError("PyVISA required for accessing VISA instruments.")

version = int(visa.__version__.replace(".", ""))
version = int(visa.__version__.replace(".", "").ljust(3, "0"))
# pylint: disable=no-member
if (version < 160 and isinstance(conn, visa.Instrument)) or \
(version >= 160 and isinstance(conn, visa.Resource)):
self._conn = conn
Expand Down

0 comments on commit 0f226a5

Please sign in to comment.